Add date time format annotation on pojo for model query parameters (#5437)

* Add date time format annotation on pojo for model query parameters

* Regenetare samples

* update spring samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Gonzalo
2020-04-12 03:39:16 +02:00
committed by GitHub
parent 800293ccf9
commit 6a158de431
39 changed files with 131 additions and 0 deletions

View File

@@ -47,9 +47,11 @@ public class FormatTest {
private Resource binary;
@JsonProperty("date")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)
private LocalDate date;
@JsonProperty("dateTime")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime dateTime;
@JsonProperty("uuid")

View File

@@ -24,6 +24,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private UUID uuid;
@JsonProperty("dateTime")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime dateTime;
@JsonProperty("map")

View File

@@ -26,6 +26,7 @@ public class Order {
private Integer quantity;
@JsonProperty("shipDate")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime shipDate;
/**