Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Ensure compliancy of Optional serialization for 2.6.0, wrt null checks #66

Closed
cowtowncoder opened this issue Apr 1, 2015 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

As per discussion on Jackson-dev list, serialization inclusion checks for various "optional" types should work such that 'absent' value is NOT considered null-equivalent (only actual Java null should qualify), but need to be considered "empty" (and "default" where applicable, usually absent would be included but it depends).

This means a change for Guava module to get it in line with JDK8 Optional, and other similar referential types.

Since this is backwards incompatible change, an additional configuration property should be added in GuavaModule. Whether it should default to existing 2.5 behavior or not is open to discussion -- at this point I assume it should.

@cowtowncoder
Copy link
Member Author

Added GuavaModule.configureAbsentsAsNulls(boolean) that allows changing behavior.
Default state retained as true (that is: yes, filter out like nulls, as needed) for backwards compatibility.

@cowtowncoder cowtowncoder added this to the 2.6.0 milestone Apr 29, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant