Skip to content

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

@cowtowncoder

Description

@cowtowncoder

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.17Issues planned at earliest for 2.17

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions