Custom JSON name for a data class field #1150
Unanswered
cannonrush
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When declaring my DTOs using data classes, do I need to duplicate JSON annotations for a custom name to apply on both serialization and deserialization, or am I missing some configuration? E.g.,
@paramtarget, Jackson is complaining about not being able to instantiate the type:@fieldtarget, Jackson is serializing the object as{"customProperty":"..."}, ignoring the name override.@JsonProperty("custom_property")it seems to behave the same as@param:JsonProperty("custom_property"). This used to work with Jackson 2 (applied on serialization, but is not not working with Jackson 3.Beta Was this translation helpful? Give feedback.
All reactions