-
-
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
No way to explicitly disable wrapping in custom annotation processor #4595
Comments
Ok, first work-arounds possible... Logic change is in If you do need to combine dynamically multiple |
But so, on possible actual fix. I think I could make this change, although bit hesitant to do in 2.17(.2), instead of 2.18. But one thing that I think I would need is a test case -- could you create a unit test to show the problem? It would need to go in In the meantime, I'll create a PR to show what might work. |
Actually, I think only Also, there is also the question of proper placement; in some ways, check in |
Created #4596 (against 2.17) with proposed fix. |
Thanks for the quick resolution! Is there an ETA for the release by any chance?
How do I register my custom subclass of the default introspector? While I really have dug into the code, I have not found a way to "replace" the default, rather than registering a new one.
Created a test here: FasterXML/jackson-dataformat-xml#659 |
On Mon, Jun 24, 2024 at 1:37 AM SimonCockx ***@***.***> wrote:
Thanks for the quick resolution! Is there an ETA for the release by any
chance?
To avoid its use, and merging logic, you might be able to sub-class
default AnnotationIntrospector (for plain JSON it'd be
JacksonAnnotationIntrospector, but for XML
JacksonXmlAnnotationIntrospector), instead of registering your own.
How do I register my custom subclass of the default introspector? While I
really have dug into the code, I have not found a way to
"replace" the default, rather than registering a new one.
ObjectMapper (and sub-classes) has something like
"setAnnotationIntrospector()", and I think "XmlMapper.builder()" probably
"annotationIntrospector(introspector)"
But one thing that I think I would need is a test case -- could you create
a unit test to show the problem? It would need to go in
jackson-dataformat-xml, but I can take care of that part.
Created a test here: FasterXML/jackson-dataformat-xml#659
<FasterXML/jackson-dataformat-xml#659>
Thank you!
-+ Tatu +-
… —
Reply to this email directly, view it on GitHub
<#4595 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANOGLBJTM4R6DPFBUVNXDZI7LDBAVCNFSM6AAAAABJXIIIFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVHEZDQOJRGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
### What changes were proposed in this pull request? This PR amis to upgrade `fasterxml.jackson` from 2.17.1 to 2.17.2. ### Why are the changes needed? There are some bug fixes about [Databind](https://github.com/FasterXML/jackson-databind): [#4561](FasterXML/jackson-databind#4561): Issues using jackson-databind 2.17.1 with Reactor (wrt DeserializerCache and ReentrantLock) [#4575](FasterXML/jackson-databind#4575): StdDelegatingSerializer does not consider a Converter that may return null for a non-null input [#4577](FasterXML/jackson-databind#4577): Cannot deserialize value of type java.math.BigDecimal from String "3." (not a valid representation) [#4595](FasterXML/jackson-databind#4595): No way to explicitly disable wrapping in custom annotation processor [#4607](FasterXML/jackson-databind#4607): MismatchedInput: No Object Id found for an instance of X to assign to property 'id' [#4610](FasterXML/jackson-databind#4610): DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS does not work when used with Polymorphic type handling The full release note of 2.17.2: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.17.2 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47241 from wayneguow/upgrade_jackson. Authored-by: Wei Guo <[email protected]> Signed-off-by: yangjie01 <[email protected]>
### What changes were proposed in this pull request? This PR amis to upgrade `fasterxml.jackson` from 2.17.1 to 2.17.2. ### Why are the changes needed? There are some bug fixes about [Databind](https://github.com/FasterXML/jackson-databind): [apache#4561](FasterXML/jackson-databind#4561): Issues using jackson-databind 2.17.1 with Reactor (wrt DeserializerCache and ReentrantLock) [apache#4575](FasterXML/jackson-databind#4575): StdDelegatingSerializer does not consider a Converter that may return null for a non-null input [apache#4577](FasterXML/jackson-databind#4577): Cannot deserialize value of type java.math.BigDecimal from String "3." (not a valid representation) [apache#4595](FasterXML/jackson-databind#4595): No way to explicitly disable wrapping in custom annotation processor [apache#4607](FasterXML/jackson-databind#4607): MismatchedInput: No Object Id found for an instance of X to assign to property 'id' [apache#4610](FasterXML/jackson-databind#4610): DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS does not work when used with Polymorphic type handling The full release note of 2.17.2: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.17.2 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47241 from wayneguow/upgrade_jackson. Authored-by: Wei Guo <[email protected]> Signed-off-by: yangjie01 <[email protected]>
### What changes were proposed in this pull request? This PR amis to upgrade `fasterxml.jackson` from 2.17.1 to 2.17.2. ### Why are the changes needed? There are some bug fixes about [Databind](https://github.com/FasterXML/jackson-databind): [apache#4561](FasterXML/jackson-databind#4561): Issues using jackson-databind 2.17.1 with Reactor (wrt DeserializerCache and ReentrantLock) [apache#4575](FasterXML/jackson-databind#4575): StdDelegatingSerializer does not consider a Converter that may return null for a non-null input [apache#4577](FasterXML/jackson-databind#4577): Cannot deserialize value of type java.math.BigDecimal from String "3." (not a valid representation) [apache#4595](FasterXML/jackson-databind#4595): No way to explicitly disable wrapping in custom annotation processor [apache#4607](FasterXML/jackson-databind#4607): MismatchedInput: No Object Id found for an instance of X to assign to property 'id' [apache#4610](FasterXML/jackson-databind#4610): DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS does not work when used with Polymorphic type handling The full release note of 2.17.2: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.17.2 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47241 from wayneguow/upgrade_jackson. Authored-by: Wei Guo <[email protected]> Signed-off-by: yangjie01 <[email protected]>
### What changes were proposed in this pull request? This PR amis to upgrade `fasterxml.jackson` from 2.17.1 to 2.17.2. ### Why are the changes needed? There are some bug fixes about [Databind](https://github.com/FasterXML/jackson-databind): [apache#4561](FasterXML/jackson-databind#4561): Issues using jackson-databind 2.17.1 with Reactor (wrt DeserializerCache and ReentrantLock) [apache#4575](FasterXML/jackson-databind#4575): StdDelegatingSerializer does not consider a Converter that may return null for a non-null input [apache#4577](FasterXML/jackson-databind#4577): Cannot deserialize value of type java.math.BigDecimal from String "3." (not a valid representation) [apache#4595](FasterXML/jackson-databind#4595): No way to explicitly disable wrapping in custom annotation processor [apache#4607](FasterXML/jackson-databind#4607): MismatchedInput: No Object Id found for an instance of X to assign to property 'id' [apache#4610](FasterXML/jackson-databind#4610): DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS does not work when used with Polymorphic type handling The full release note of 2.17.2: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.17.2 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#47241 from wayneguow/upgrade_jackson. Authored-by: Wei Guo <[email protected]> Signed-off-by: yangjie01 <[email protected]>
When upgrading from Jackson 2.15.0 to 2.17.1, we noticed our custom annotation processor stopped working due to a change in behaviour in the way
PropertyName
s are merged. See #4364. I would like to know whether this is intended, and if it is, how I should migrate my code.We have a custom XML annotation introspector which explicitly sets the wrapper name to
Property.NO_NAME
if our custom annotation is present and the type is a list:This used to work in Jackson 2.15.
Unfortunately, due to the change in #4364,
PropertyName.NO_NAME
is now merged withPropertyName.DEFAULT
from the default Jackson XML annotation introspector, and the new behaviour prefersPropertyName.DEFAULT
overPropertyName.NO_NAME
. The previous behaviour would preferPropertyName.NO_NAME
.I have not found a way to fix this. Is there a way to get rid of the default annotation processor?
Originally posted by @SimonCockx in #4364 (comment)
The text was updated successfully, but these errors were encountered: