-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jdk8Module support for java8 Date classes serialization #35
Comments
I think you may have misunderstood what modules in question provide; While name
This division of modules has been in place during Jackson 2.x and can not be simply changed without other complications. But with Jackson 3.x baseline for JDK will be increased so that module structure will probably be changed -- most likely so that "optionals" and parameter-names support will be in-built, and date/time types remain as an add-on (due to size of module; other 2 aspects are relatively small). |
But jackson-datatype-jsr310 stated as DEPRECATED. It says: |
@pragmaticway Yes: the git repository itself is deprecated, and module within has moved under I can understand that this might be confusing, but I would hope users take some time to try to solve the problem, and where applicable, suggest improvements to descriptions. I will try to improve the wording to reduce confusion. |
@cowtowncoder Thank you for clarifying! Yes indeed the documentation about deprecated module is somewhat ambiguous and confusing. Myself and my teammates were under impression that we supposed to use That was adding to the confusion. Now since its clarified that jsr310 module is not deprecated, it makes more sense. |
I'm moving from JSR310Module to Jdk8Module and have noticed that Jdk8Module is not supporting java8 Date classes (LocalDateTime, etc.)
So my old JSR310 code that is producing correct date/time format is:
so it generates "2017-07-28T12:32:39.927"
But when I move to Jdk8Module:
it generates "{"year":2017,"month":"JULY","dayOfYear":209,"dayOfWeek":"FRIDAY","dayOfMonth":28,"monthValue":7,"hour":12,"minute":45,"second":53,"nano":458000000,"chronology":{"id":"ISO","calendarType":"iso8601"}}"
After looking around in the docs looks like Jdk8Module isn't supporting Java8 new date classes. Instead I have to use JSR310's JavaTime module for that:
so it generates "2017-07-28T12:32:39.927"
Can you please implement support for java8 new Date classes in Jdk8Module (not in some other module)?
Thank you in advance!
The text was updated successfully, but these errors were encountered: