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

Make BeanDeserializer consider DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES to avoid buffering #3643

Open
cowtowncoder opened this issue Oct 24, 2022 · 0 comments
Labels
2.15 Issues planned for 2.15 performance Issue related to performance problems or enhancements to-evaluate Issue that has been received but not yet evaluated

Comments

@cowtowncoder
Copy link
Member

Currently BeanDeserializer has _ignoreAllUnknown flag but it is only set if per-class annotation @JsonIgnoreProperties(ignoreUnknown = true) (or its ConfigOverride equivalent) is specified.
This flag is used to optimize handling to skip buffering for unknown properties; it would make sense to make it also consider that if DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabled, property value need not be buffered.

It'd be good to test detection as well to ensure we know how settings work; perhaps by checking how BeanDeserializerBuilder works.

Note that we might want to do dynamic check for the flag, instead of modifying _ignoreAllUnknown: this because theoretically at least DeserializationFeatures may be changed on per-call basis. And since the case of buffering seemingly unknown property value is presumably rare, minor overhead for feature-flag check is probably fine.

@cowtowncoder cowtowncoder added performance Issue related to performance problems or enhancements to-evaluate Issue that has been received but not yet evaluated 2.15 Issues planned for 2.15 labels Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.15 Issues planned for 2.15 performance Issue related to performance problems or enhancements to-evaluate Issue that has been received but not yet evaluated
Projects
None yet
Development

No branches or pull requests

1 participant