Replies: 2 comments 4 replies
-
There is field called @JsonTypeInfo(
use=JsonTypeInfo.Id.CLASS,
include=JsonTypeInfo.As.PROPERTY,
property="@class"
) |
Beta Was this translation helpful? Give feedback.
4 replies
-
There isn't anything automatic, but often |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
When using
@JsonTypeInfo
annotationproperty
parameter is used specify which exact JSON field is used to determine which exact class will be used. Let's say for example this field is namedtype
.However class that uses this annotation on one of it's fields is used by two different
ObjectMapper
s with different naming conventions set. In one naming convention this JSON field is namedtype
in otherType
.Is it possible make
@JsonTypeInfo
be naming convention aware so right JSON field is used depending which naming convention is set onObjectMapper
?If not is there any other way to achieve what
@JsonTypeInfo
does so both JSON naming conventions will work correctly?Regards
Beta Was this translation helpful? Give feedback.
All reactions