Make BeanDeserializer
consider DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
to avoid buffering
#3643
Labels
3.0
Issue planned for initial 3.0 release
performance
Issue related to performance problems or enhancements
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 becauseDeserializationFeature
s may be changed on per-call basis (and since it can, inevitably someone will :) ).And since the case of buffering seemingly unknown property value is presumably rare, minor overhead for feature-flag check is probably fine.
The text was updated successfully, but these errors were encountered: