Apply @JsonNaming on serialization only #3971
-
|
Is there a way to use Is this possible for serialization only? Currently, to achieve this I'm using the following on all fields I want to convert. For example: But I'm looking for an efficient configuration without having to apply these 2 annotations on each field on each classes that I want to use this naming strategy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
No, unfortunately there is no way to apply Possible work-around would be to use 2 different mappers, and maybe configuring mix-in annotation for serialization case (to associate |
Beta Was this translation helpful? Give feedback.
No, unfortunately there is no way to apply
@JsonNamingonly on serialization; it will be used for transforming names in both directions.Possible work-around would be to use 2 different mappers, and maybe configuring mix-in annotation for serialization case (to associate
@JsonNamingon class(es).Or using custom
AnnotationIntrospectorto block application of@JsonNamingfor deserialization-side.