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

JacksonXmlAnnotationIntrospector.findNamespace() should properly merge namespace information #637

Closed
cowtowncoder opened this issue Feb 3, 2024 · 0 comments
Labels
2.17 Issues planned at earliest for 2.17

Comments

@cowtowncoder
Copy link
Member

(note: offshoot of #628)

Looks like method findNamepace() in JacksonXmlAnnotationIntrospector is considering both @JsonProperty and @JacksonXmlNamespace (latter having precedence) but does not support case like so:

       @JsonProperty(value="value", namespace="uri:ns1")
        @JacksonXmlProperty(isAttribute=true)
        public int valueDefault = 42;

in which @JacksonXmlProperty does not define namespace (that is, is left as "", empty String).
In such case it should then return namespace value of @JsonProperty instead.

Ideally in future we could simply use methods from AnnotationIntrospection -- findNameForSerialization() and findNameForDeserializaiton -- which also expose "namespace", but on short term let's handle merging better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.17 Issues planned at earliest for 2.17
Projects
None yet
Development

No branches or pull requests

1 participant