Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Add support for empty and default value serialization (filtering) #7

Open
cowtowncoder opened this issue Jan 14, 2015 · 3 comments
Open

Comments

@cowtowncoder
Copy link
Member

It would make sense to be able to prune empty (and default value) output when serializing.

@mkoegel
Copy link

mkoegel commented Jul 16, 2015

Would be great to get this and also honor the SerializationFeature.WRITE_EMPTY_JSON_ARRAYS setting.

@cowtowncoder
Copy link
Member Author

I will add a separate feature request for that, thank you for suggestion.

@cowtowncoder
Copy link
Member Author

Adding isEmpty() methods is easy (and now done), but turns out that we need bit more elaborate support to make recursive serialization handling work as expected. Problem being that exclusion is "off by one", that is, calling BeanSerializer checks inclusion. But object/array serializer also needs configuration information for content; and this is where things get interesting.
Due to timing, can not get this done for 2.6, but may revisit for 2.7. Doing this also allows considering similar support for jackson-databind JsonNode, which should be nice; we can use this package as sort of prototype or dry dun.

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

2 participants