Replies: 1 comment 7 replies
-
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am experiencing an unexpected difference in the way quarkus-resteasy-reactive-jaxb handles XML namespace prefixes when switching from non-reactive (io.quarkus:quarkus-resteasy-jaxb:2.16.4.Final) to reactive (io.quarkus:quarkus-resteasy-reactive-jaxb:2.16.4.Final).
Reproducer
The code defines (available at https://github.com/gnieser/quarkus-jaxb):
The code also defines two additional namespaces that are exclusive to each other and never use in the same XML:
Issue
The troublesome element is that while these two XML namespaces are never used together in the same response they define the same prefix for their respective namespace.
It may look weird, but this is a simplification of what a set of third party XSD schemas would produce through XJC. I have simplified to extreme and removed XJC from the equation.
Using quarkus-resteasy-jaxb
Only the namespaces in use in the Response are added to the XML so everything works fine:
Using quarkus-resteasy-reactive-jaxb
Even the namespaces not in use are added to the Response. So ensues a conflict in the prefixes, and one of them is set to ns2 and the XML response becomes:
Question
I understand that part of the issue is the conflicting prefixes, but I feel like something may be done to prevent:
How can I guide quarkus-resteasy-reactive-jaxb to only add XML namespace definitions for the namespace that are actually part of the Response, and behave more like its non-reactive counterpart?
Note that even with a change to the prefixes (set to 'u' and 'p'), the unused namespace is still added to the XML:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions