-
Notifications
You must be signed in to change notification settings - Fork 117
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
DeserializationFeature ALLOW_DATES_AS_TIMESTAMPS #171
Comments
There is no specific setting that could be used here, although there are multiple ones that could possibly apply, without adding new Wrt existing things, possibilities include:
But assuming we don't want to use either of above (I think second one would be better, but neither is optimal), there would be choice between new https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-5 idea of which is to create subset of Date/Time-specific settings, possibly including simple on/off features ( What we probably should start doing is to collect kinds of things that need configuring. |
One more thing about adding EDIT: One minor additional note I realized: use of |
Yeah, I agree, that the date time stuff is a huge topic. Right now, i guess a workaround could be to provide a custom set of date time deserializers, that simply checks if the value is a number. If true, throw exception. If false, call the original deserializer.
That sounds reasonable, too. |
After writing all of above, I am beginning to think that |
Alternatively, could use newly (2.16) added |
With SerializationFeature.WRITE_DATES_AS_TIMESTAMPS it's possible to output date and time data as ISO 8601, but there seems to be no way to only accept date and time data in ISO 8601 format.
Though I'd suggest to add some kind of
DeserializationFeature.ALLOW_DATES_AS_TIMESTAMPS
orMapperFeature.ALLOW_COERCION_OF_DATES
which disables the coercion of date and time data.In other words:
{"myInstant": 123456789}
should throw an exception, and only{"myInstant": "1973-11-29T21:33:09Z"}
should be allowed.Or is there already an setting that I missed?
The text was updated successfully, but these errors were encountered: