-
-
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
Use JsonTypeInfo.Value
for annotation handling
#3953
Use JsonTypeInfo.Value
for annotation handling
#3953
Conversation
Looks good so far @JooHyukKim ! One more thing that'd be great to check before I merge -- would it be possibly to locally build 2.16.0-SNAPSHOT from this PR/branch, and see that If not, I can try this myself later tonight. |
EDIT: Found a fix and described it in below comment. |
src/main/java/com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.java
Show resolved
Hide resolved
@@ -1568,6 +1568,17 @@ protected StdTypeResolverBuilder _constructStdTypeResolverBuilder() { | |||
return new StdTypeResolverBuilder(); | |||
} |
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.
I did put this back in here after realizing that removing this method will break extensions such as Xml
Phew, took long journey going back and forth projects and versions trying to debug 😂
EDIT
So, this is a breaking change for usage case like XML module. Do you think we can handle this in a safe way, @cowtowncoder ? |
@JooHyukKim It's ok to have temporary breakage during changes, although that won't prevent issues across different minor versions of components which we try to limit. For example, ideally 2.15 of |
JsonTypeInfo.Value
usages from Jackson 3.0JsonTypeInfo.Value
for annotation handling
Right, thank you fhr the explanation! 🙏🏼🙏🏼 |
Hi @JooHyukKim and @cowtowncoder ! I updated my code to version 2.16.0 and instantly started to receive a ton of exceptions in my code. I checked the differences between 2.15.3 and 2.16.0 and tracked back the problem to this PR. Now, I receive this error:
I followed linked issues and tried to play with my mapper which looks like this: @Bean
public Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
return new Jackson2ObjectMapperBuilder()
.modules(new Jdk8Module(), new JavaTimeModule())
//.featuresToEnable(MapperFeature.REQUIRE_TYPE_ID_FOR_SUBTYPES) I tried enabling and disabling this but it doesn't change anything
.serializationInclusion(JsonInclude.Include.NON_NULL)
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
} I must admit I'm no expert with all these libraries and settings and this code is not mine but I can definitely confirm that this is breaking. Is there any official documentation that I could follow to fix this breaking change and maybe use the "new way of doing things"? |
@JFCote the described issue does not relate to this issue. The error is because jackson modules were upgraded partiallly.
|
Thanks @JooHyukKim ! In fact, I was not importing |
Yeah, transitive dependency problem is real 🙉. Glad it helped! |
(original PR is #3942, but had to create a new branch due to complex git rebase conflicts)
As a part of #3943, this PR applies
JsonTypeInfo.Value
usages from Jackson 3.0