API supporting application/xml and application/hal+json #43835
Unanswered
muItilingualism
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi, I am having trouble getting application/xml and application/hal+json to work together.
I'm using
quarkus-hal
andquarkus-rest-links
for hal+json, xml is just JAXBI have an endpoint
A User object looks like this
This does not compile, because JAXB needs the List to be wrapped in a parent class, like the following:
So lets do that and also change the endpoint to look like the following
New problems arise.
1a. Hence, the the xml format is now malformed due to the new ID field
1b. And the hal+json format is malformed both due to the new ID field but also because it now serializes an custom parent class instead of a collection.
Has anyone else ever had this issue? My solution for now is to give up XML as JSON generally is favored.
Any and all suggestions please!
Beta Was this translation helpful? Give feedback.
All reactions