-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
JsonIdentityInfo for Map (not pojo) #5120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What about it? Could u clarify the intention of this issue? Seems like Bug Report has been filed. Did identity-info feature ever worked with Maps? |
I'de like to serialize an immutable Map, however, the Map has cyclical references (e.g. map of maps of maps). I can't use any of the POJO annotations (backrefs, Ignore, etc.) as its a dynamic model. I just want to specify the max depth to traverse down the map tree (graph). Anyone know the easiest way to control the depth of the serializer in either configuration, or perhaps how to override the recursive traversal method in jackson? |
Jackson has StreamReadConstraints and one applies a default limit to how deep the Jackson parser will traverse. Nesting Depth is the constraint name. |
Easiest thing would be to use a wrapper, to be honest: POJO that contains Otherwise in theory you could use mix-in annotations to associate with specific Map type but I am not confident it would work correctly. This may be one of rare cases where I'd suggest considering custom (de)serializers. |
On constraints: for reading (deserialization), we have |
Search before asking
Describe the bug
I know that @JsonIdentityInfo can resolve the recyle reference for pojo, but how about the Map object?
Version Information
No response
Reproduction
<-- Any of the following
-->
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: