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

Jackson module auto-discovery sets Jaxb Annotation Introspector as primary #4723

Closed
kincajou opened this issue Feb 16, 2021 · 1 comment · Fixed by #4731
Closed

Jackson module auto-discovery sets Jaxb Annotation Introspector as primary #4723

kincajou opened this issue Feb 16, 2021 · 1 comment · Fixed by #4731
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kincajou
Copy link

Hello.

Initially, when creating Jackson' ObjectMapper for Jersey needs, annotation introspectors order is defined - Jackson annotations first, JAXB annotations second (org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider#DEFAULT_ANNOTATIONS).

31bd872 introduced module auto-discovery. If we have JAXB module in class path, when it is discovered and registered, it pushes JAXB annotation introspector back to primary (that's the default behavior of the module), thus breaking intended logic.

It looks like a bug, but maybe I'm missing something? Some configuration options?

@dzharikhin
Copy link

dzharikhin commented Feb 16, 2021

It really hurts in DTOs with mixed annotations(jaxb ones are used for legacy xml endpoints).
ex.

public class Dto {
  @XmlElement(name = "jaxb")
  @JsonProperty("jackson")
  public String field;
}

response for Dto("abc") is {"jackson": "abc"} for v. 2.30.1, but for v. 2.32 it's {"jaxb": "abc"}

@senivam senivam linked a pull request Feb 24, 2021 that will close this issue
@senivam senivam added bug Something isn't working and removed triage needed labels Feb 24, 2021
@senivam senivam self-assigned this Mar 3, 2021
@senivam senivam added this to the 2.34 milestone Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants