Closed
Description
I'm trying to define a custom patterns for this classes but sems that the @JsonFormat
is ignored.
Jackson version: 2.9.3
Jackson datatype version: 2.9.6
Example of @JsonFormat
anotation:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd/MM/yyyy HH_mm_ss_SSS|z")
private Instant customInstant;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM")
private YearMonth customYearMonth;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM_dd")
private MonthDay customMonthDay;
Current result:
When serialize the fields are formated with the default pattern and when deserialize a exception is throw.
Expected result:
Serialization and deserialization works sucessfully using the defined pattern.
Thanks !
Metadata
Metadata
Assignees
Labels
No labels