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

Any way to globally opt-out of JSONB's "Must-Ignore" policy? #56

Open
jansupol opened this issue Sep 21, 2017 · 2 comments
Open

Any way to globally opt-out of JSONB's "Must-Ignore" policy? #56

jansupol opened this issue Sep 21, 2017 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@jansupol
Copy link
Owner

I am attempting to change the implementation of some code to use JSON-B instead of Jackson. In the process of doing so, I would like to match behavior so existing users are not impacted. One key behavior difference I have found is during deserialization Jackson will reject unrecognized properties, whereas JSON-B will simply ignore unrecognized properties.

I was looking around the API for a way to reject unrecognized properties (ideally via JsonbConfig). I posted this question on SO, but eventually I ran across this section of the JSON-B spec:

3.18 Must-Ignore policy
When JSON Binding implementation during deserialization encounters key in key/value pair that it does not recognize, it should treat the rest of the JSON document as if the element simply did not appear, and in particular, the implementation MUST NOT treat this as an error condition.

So this explains why the default behavior is the way it is... but is there any way to opt-out of this? It would be a key part of migrating existing applications from Jackson to JSON-B.

@jansupol
Copy link
Owner Author

@m0mus Commented
Adding it to version 2.0 proposed features.

@jansupol
Copy link
Owner Author

@jansupol jansupol added the enhancement New feature or request label May 23, 2018
@jansupol jansupol added this to the 2.0 milestone May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant