Jackson @JsonFormat Example
By 난누구여긴어디 | 2019년 5월 12일 |
JsonFormat.Shape.STRINGWhen we assign JsonFormat.Shape.STRING to shape attribute in @JsonFormat for a property, suppose Date type, then in serialization JSON will be string type in given pattern for that property.public class Writer { @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MMM-dd HH:mm:ss z") @JsonProperty("pubDate") private Date recentBookPubDate;} Output will be as foll