Skip to content
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

Serialize formerly unserializable Jackson types like ObjectMapper as Empty Object value #3302

Closed
cowtowncoder opened this issue Oct 15, 2021 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: actual changes were done as part of fix for #3244 - this is for documenting side effects)

With Jackson 2.x up to 2.12 a few central processing entities are not serializable by Jackson itself: they cannot be deserialized due to state, and sometimes contain problematic things like cyclic references, resulting in various Exceptions or even errors (like StackOverflowError) being thrown.

But while they cannot be deserialized there is no reason why they could not be serialized using a placeholder value like Empty Object ({ } in case of JSON).
So let's do that for following types (and their subtypes)

  • ObjectMapper (and format-specific subtypes)
  • ObjectReader
  • ObjectWriter
  • DatabindContext (subtypes SerializerProvider, DeserializationContext)
  • TokenStreamFactory (subtypes JsonFactory etc)
  • JsonParser (and format-specific subtypes)
  • JsonGenerator (and format-specific subtypes)
@cowtowncoder cowtowncoder added this to the 2.13.0 milestone Oct 15, 2021
@cowtowncoder
Copy link
Member Author

As per notes above, was fixed in 765e2fe .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant