-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add new SerializationFeature
, WRITE_DATES_WITH_ZONE_ID
to be used by Date/Time modules
#794
Comments
Does this feature prescribe a particular format (e.g. https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_ZONED_DATE_TIME)? |
@tommack if there is consensus on appropriate default format to use, it could and should. |
I'd definitely go with a standardized format, and I'd pick java 8's |
@zkiss Sounds good to me then. I will include this note in javadocs. One question regarding support: while this is easy to support for JSR-310 module (I assume), and Joda as well I hope, is this something that can easily be supported for basic |
@cowtowncoder That's a good question. Haven't looked into this, but in theory it is possible that even joda ans jsr310 have differences in time zone identifiers. Typos or different namings are possible (although I'd assume with a low chance). Regarding the old java date API a quick search suggests to me it also supports standardized time zone names. Because of this, I'd first assume there are no differences, maybe check some of them manually, then deal with bugs later as needed. |
@zkiss Fair enough. We can assume it is fair to expect this format -- while it is not the safest choice (might prove to be wrong), there isn't much value in saying "what this really means depends entirely on module". |
If both WRITE_DATES_WITH_ZONE_ID and WRITE_DATES_AS_TIMESTAMPS are true, is WRITE_DATES_WITH_ZONE_ID ignored? |
@tommack Yes. |
Feature itself added; use is up to modules: jsr-310 module uses this, but Joda not yet. |
@cowtowncoder AFAIK jsr310 still does not use the feature (I've just checked branch master to make sure). In order to use it serializers (and maybe deserializers as well) should be modified. |
Oh. So the merge was only for separating different modules without functional difference yet? |
Long term solution is still to be implemented, by modifying the serializer registered by |
@zkiss ah ok. I will actually reopen this then as a reminder, although separate issues are needed for modules. |
Implemented for Joda module for 2.6.0, closing. |
note: cleaved off of FasterXML/jackson-datatype-jsr310#15 -- check out that discussion more complete view.
There are conflicting goals regarding serialization of timezone id information. For example:
Introduction of this
SerializationFeature
would allow explicitly choosing between two options, as the global default.Note: we may also need per-property overrides. But let's tackled that if and when necessary.
The text was updated successfully, but these errors were encountered: