jsonschema2pojo icon indicating copy to clipboard operation
jsonschema2pojo copied to clipboard

Optionally exclude the timezone from the generated @JsonFormat annotation for date-time fields

Open jevring opened this issue 5 years ago • 2 comments

By default, when enabling formatting for fields with "type: date-time", the time-zone is always forced to UTC. This feature adds a flag where this can be disabled, which means that there will be no time-zone specified in the @JsonFormat annotation, which means that when we produce json from an object with jackson, it uses whatever timezone the date was in already. This is only really worthwhile when not using java.util.Date, such as for example java.time.ZonedDateTime.

NOTE: The integration tests I wrote work fine in IntelliJ IDEA, but they don't generate any annotations when run through maven. I'm not quite sure why this is, or if it is just a local issue for me. It would be nice if someone else could verify this and possibly help me resolve it, if it is indeed an issue for others.

jevring avatar Oct 21 '19 13:10 jevring

@joelittlejohn Any idea on why that test failure happens? Why the annotations aren't being generated when I run it through maven, whereas they do when I run it through IntelliJ IDEA?

jevring avatar Oct 22 '19 07:10 jevring

The problem is still valid. Please raise the priority. I have to delete the time zone with my hands

antonovdmitriy avatar Nov 01 '20 18:11 antonovdmitriy