globally configure Json type id? #185
-
By default, Jackson includes the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Can you provide
I only partially understood the problem and expected solution here 🤔 |
Beta Was this translation helpful? Give feedback.
-
When I serialized it, the json string was
, but due to subsequent refactoring, my class:
. The class package path is changed, If I use the default configuration , deserialization will throw an error. |
Beta Was this translation helpful? Give feedback.
-
Jackson does NOT by default include any type id -- these are only added if Aside from that, example seems to use Lombok which adds its own possible complications. I am not quite sure what exactly is being asked here th0. |
Beta Was this translation helpful? Give feedback.
Jackson does NOT by default include any type id -- these are only added if
@JsonTypeInfo
annotation is added to the base class OR "default typing" is enabled.Use of default typing is discouraged: it should not be used unless one really knows what they are doing.
I am guessing you are enabling that for some reason: it is better not to do that and add explicit
@JsonTypeInfo
where type id is needed.Aside from that, example seems to use Lombok which adds its own possible complications. I am not quite sure what exactly is being asked here th0.