Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All what is needed is registering SwaggerToOpenApiConversionFilter with the JAX-RS endpoint and requesting an "openapi.json" as opposed to "swagger.json". The filter will let Swagger2Feature generate JSON as usual and then convert the response to OpenAPI JSON if requested by the user or leave it intact otherwise. By issuing either "swagger.json" or "openapi.json" queries one can easily see the difference  between the two formats.

The cxf-rt-rs-json-basic dependency must be on the classpath as well.

Note, OpenAPI JSON allows referring to its new "components/requestBodies" section from the multiple "requestBody" elements (which can be found under the specific path/http verb sub-sections). By default the filter will instead inline the the "requestBody" definitions inside of "requestBody" elements, but one can experiment with referring to the "components/requestBodies" by configuring the filter to create the request bodies.   

...