Closed
Description
Hi,
The content negociation depending on the accept
http header doesn't work (or there's some configuration not described in the doc)
Steps to Reproduce
- Create a 1.3 project
- Add https://github.com/micronaut-projects/micronaut-jackson-xml dependency to be able to bind & serialise XML
- Create a controller with
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
and@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- call your controller with the
accept: application/xml
header
Expected Behaviour
The result should be in XML.
Actual Behaviour
The result is still in JSON
I must say that if you only need XML output and add @Produces(MediaType.APPLICATION_XML)
in your controller, the ouput is correctly serialized in XML.
Environment Information
- Operating System: Ubuntu 18.04
- Micronaut Version: 1.3.0
- JDK Version: 11.0.5
Thanks
Regards,
Bruno