Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
6.2.0
-
None
Description
This ticket addresses 2 items
Wrapping response generated schema into Root element
The way how CXF generates the JSON a response looks like this:
{ "serviceResult": { "message": "9f51e7d6-e662-463a-b410-7bf31357f111", "type": "SUCCESS" } }
It wraps it into a "serviceResult", while that part is not really part of the schema.
Based on our API definition it would expect:
{ "message": "9f51e7d6-e662-463a-b410-7bf31357f111", "type": "SUCCESS" }
=> no wrapping into a "serviceResult": { ... }
There is a way to turn off this generation of wrapping / root elements in CXF. But that would break existing clients.
So the challenge is to generate an API definition that actually matches the response.
The only way to generate the correct documentation seems to be to wrap the schema class into a wrapper object so that the schema matches the generated json response and have that wrapper as meta information for the swagger.annotation to the swagger annotation.
It would be better to drop the root / wrapping element on the long run in CXF. But that would be a breaking change to the API and probably require a new version.
Providing Example responses
There isn't a possibility to provide example responses at the moment.
Also it might be better to generate those into separated classes so that the API class won't get too large to read.
Attachments
Issue Links
- links to