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

Add new option to handle properties not part of current active @JsonView #4275

Merged
merged 4 commits into from
Dec 22, 2023

Conversation

JooHyukKim
Copy link
Member

resolves both #4108 and #437

@cowtowncoder
Copy link
Member

Whoa! This is AWESOME! Getting to solve old AND "Most wanted" issue(s). Well done.

@cowtowncoder cowtowncoder merged commit ef4f292 into FasterXML:2.17 Dec 22, 2023
5 checks passed
@toolforger
Copy link

 * In Jackson 2.x, this feature is disabled by default to maintain backward compatibility.
 * In Jackson 3.x, this feature may be enabled by default.

That's just how it should be, awesome!

@cowtowncoder
Copy link
Member

We'd need a PR to change defaults (and Javadoc) for 3.0 (master) if anyone has time?

// [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]",
Copy link
Member

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)

Copy link
Member Author

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! 👍🏼

@JooHyukKim
Copy link
Member Author

We'd need a PR to change defaults (and Javadoc) for 3.0 (master) if anyone has time?

Will do 👍🏼 cc @cowtowncoder

@JooHyukKim JooHyukKim deleted the 4108-multiple-view-option branch December 23, 2023 01:31
cowtowncoder added a commit to FasterXML/jackson-dataformats-text that referenced this pull request Jan 13, 2024
…e.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES enabled by default in 3.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.17 Issues planned at earliest for 2.17
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants