Rest api - Support xml and content negotiation

For my project I’m, exposing some rest services to import and export data (rest service api, not the entity api) In fact, for my api I will map the domain entities to legacy jaxb annotated TO’s.

I see that CUBA uses (at least part of) spring web where xml and content negotiation is supported.
With spring web this should be rather easy.

For the future it would also be interesting to allow both xml and json via content negotation (also supported by spring-web)

  1. Is there a way to let cuba use jaxb to serialize the content to xml?
  2. Is there a way to enable content negotation so the client can choose what format he will receive?

we don’t plan to support XML in a standard REST API, but you are free to create your own Spring MVC controllers. See this section in the documentation if you need your controllers to be OAuth protected.

Excellent, that was actually my secret question 3.

thanks for the swift reply.