-
-
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
Ignore Records' immutable fields in BeanDeserializerFactory instead of ignoring it in POJOPropertiesCollector, to preserve any annotation info the fields may be carrying. #4627
Conversation
…property when its accessor method is annotated with @JsonIgnore.
f2b2141
to
ea3135a
Compare
…property when a Record's component has @JsonIgnore + the corresponding accessor method is overridden without @JsonIgnore.
…f ignoring it in POJOPropertiesCollector, to preserve any annotation info the fields may be carrying.
ea3135a
to
2b4cf9f
Compare
// since there should not be setters. | ||
final boolean inferMutators = !isRecordType() | ||
&& _config.isEnabled(MapperFeature.INFER_PROPERTY_MUTATORS); | ||
final boolean inferMutators = _config.isEnabled(MapperFeature.INFER_PROPERTY_MUTATORS); |
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.
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.
Ok.
…operty when a Record's component has @JsonIncludeProperties/@JsonIgnoreProperties + the corresponding accessor method is overridden.
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedField.java
Outdated
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
Show resolved
Hide resolved
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
Outdated
Show resolved
Hide resolved
@yihtserns Overall I think that makes sense, given it addresses problems you demonstrated. |
@yihtserns Ugh. Could you file a separate new issue (referencing #562 and this PR)? Btw, big THANK YOU for finding all these issues as well as obviously fixing. |
@yihtserns Not only that, but looks like https://github.com/FasterXML/jackson-module-kotlin/actions/runs/10031852459 (on plus side, cascading rebuilds expose these failures sooner) /cc @k163377 |
@cowtowncoder Seems like this is a bad PR, can you please revert it and I'll see if I can rework it? Sorry for the trouble. |
@yihtserns was about to suggest the same. Will do. One thing that'd be good would be to take unit tests from here, add under |
@yihtserns Hmmmh. This is odd... Kotlin failures remain after revert. So it seems some other commit broke it, not this PR. But I don't see previous cascading build failures so I am bit confused as to what might have caused breakage. cc @k163377 Looks like there are 3 test failures for |
@cowtowncoder I suspect the Kotlin failure is caused by Kotlin refusing to play nice with FasterXML/jackson-annotations#258 (it generated a dodgy looking I downgraded |
Proposal for #4626.
Turns out Record fields (or rather the annotations on them) are needed for both serialization (#3628, #3895, #3906 (comment)) & deserialization (#4626).
So we need to either keep them or change the way/order we harvest annotation info in
POJOPropertiesCollector
(for someone who knows every little about the codebase, I only dared to propose the former).