-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add support for preservation of unknown properties #123
Comments
aseovic
added a commit
to aseovic/genson
that referenced
this issue
May 10, 2018
aseovic
added a commit
to aseovic/genson
that referenced
this issue
May 10, 2018
Perfect. This makes sense. Will take a look at the PR. |
aseovic
added a commit
to aseovic/genson
that referenced
this issue
May 20, 2018
aseovic
added a commit
to aseovic/genson
that referenced
this issue
May 21, 2018
aseovic
added a commit
to aseovic/genson
that referenced
this issue
May 21, 2018
…hed to using JsonValueConverter directly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment, Genson either silently skips over JSON properties that do not have a corresponding JavaBean property (default), or throws an exception if
failOnMissingProperty
is set totrue
.In some cases it is important and necessary to support preservation of unknown properties. For example, this allows clients and the server to have different versions of the JavaBean classes (typically, the server has the latest version with a full property set, and clients can either have the latest or one of the older versions) without losing properties that are not known to all clients and the servers as JSON documents move through the system.
Jackson supports this via
@JsonAnySetter
and@JsonAnyGetter
annotations, but I believe a better approach would be to support unknown property handling in a generic way, and the users can decide what theUknownPropertyHandler
should do during serialization and deserialization.I have already implemented a proposal and will submit a pull request shortly, but just wanted to open this issue to provide some context for the PR.
The text was updated successfully, but these errors were encountered: