Handling Unknown JSON Properties with Jackson
Posted
by henrik_lundgren
on Stack Overflow
See other posts from Stack Overflow
or by henrik_lundgren
Published on 2010-05-04T08:34:22Z
Indexed on
2010/05/04
8:38 UTC
Read the original article
Hit count: 446
Hi,
For deserializing json with unknown field into an object there's @JsonAnySetter.
But what if I read such json into my object, modify some known fields and write it back to json? The unknown properties will be lost.
How do I handle such cases? Is it possible to map an object or do I have to read the data into a JsonNode or Map?
© Stack Overflow or respective owner