-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 new option to handle properties not part of current active @JsonView
#4275
Add new option to handle properties not part of current active @JsonView
#4275
Conversation
Whoa! This is AWESOME! Getting to solve old AND "Most wanted" issue(s). Well done. |
That's just how it should be, awesome! |
We'd need a PR to change defaults (and Javadoc) for 3.0 ( |
// [databind#4108]: fields in other views to be considered as unknown properties | ||
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES)){ | ||
ctxt.reportInputMismatch(handledType(), | ||
String.format("Input mismatch while deserializing %s. Property '%s' is not part of current active view [%s]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized one idea: should this suggest disabling of feature to allow?
(not 100% sure but might be helpful, esp. when 3.0 changes default to enabled)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, not only we state the problem, but also inform a possible solution. Makes sense, will try to propose a improved version! 👍🏼
Will do 👍🏼 cc @cowtowncoder |
…e.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES enabled by default in 3.0)
resolves both #4108 and #437