-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Is your feature request related to a problem? Please describe.
Not a problem, just lack of flexibility.
Describe the solution you'd like
It is quite normal for someone to create an ObjectMapper
and configure it with reasonable defaults that apply to the majority of serializations/deserializations done within a project. For anything that deviates from these defaults, we can annotate and override the defaults. This mechanism is great, since it allows to follow the principle of "convention over configuration", but still allows flexibility when needed.
It seems however that there is no feature in JsonFormat.Feature
allowing to override, for an individual case, the value chosen by SerializationFeature.WRITE_DATES_AS_TIMESTAMPS
.
This would be great to have, as most of the times people have a particular preference, and that is what they use on their projects, but they need to deal with 3rd parties which JSON contract differs in approach. Would be great to be able to just annotate on those specific objects.
Usage example
Potential use, if that JsonFormat.Feature
was added:
@JsonFormat(without = JsonFormat.Feature.WRITE_DATES_AS_TIMESTAMPS)
private Instant timestamp;
Additional context
No response