Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from ralf-ueberfuhr-ars/feature/rename-birthdate
Browse files Browse the repository at this point in the history
Rename birthdate to birth_date.
  • Loading branch information
ralf-ueberfuhr-ars authored Jun 18, 2024
2 parents f481fda + 483b013 commit 3020a03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.schulung.sample.quarkus;

import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.json.bind.annotation.JsonbTransient;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -19,7 +20,8 @@ public class Customer {
@Setter(onMethod_ = @JsonbTransient)
private UUID uuid;
private String name;
private LocalDate birthdate; // TODO birth_date?
@JsonbProperty("birth_date") // TODO -> use snake_case globally?
private LocalDate birthdate;
private String state;

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void shouldCreateCustomer() {
.body("""
{
"name": "Tom",
"birthdate": "2000-10-04",
"birth_date": "2000-10-04",
"state": "active"
}
""")
Expand All @@ -76,7 +76,7 @@ void shouldCreateCustomer() {
.header("Location", startsWith("http"))
.contentType(ContentType.JSON)
.body("name", is(equalTo("Tom")))
.body("birthdate", is(equalTo("2000-10-04")))
.body("birth_date", is(equalTo("2000-10-04")))
.body("uuid", is(notNullValue()))
.extract()
.header("Location");
Expand All @@ -88,7 +88,7 @@ void shouldCreateCustomer() {
.then()
.statusCode(200)
.body("name", is(equalTo("Tom")))
.body("birthdate", is(equalTo("2000-10-04")));
.body("birth_date", is(equalTo("2000-10-04")));
}

}
Expand Down
4 changes: 2 additions & 2 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ components:
- disabled
Customer:
required:
- birthdate
- birth_date
- name
type: object
properties:
Expand All @@ -259,7 +259,7 @@ components:
maxLength: 100
type: string
example: Tom Mayer
birthdate:
birth_date:
type: string
format: date
state:
Expand Down

0 comments on commit 3020a03

Please sign in to comment.