dkaras
dkaras

Reputation: 315

ReDoc + SpringFox Swagger2 + additional models

My use case is as follows: I generate the OpenAPI-compilant specification in json format using SpringFox Swagger2 in my Spring Boot application. During configuration of Docket bean I use its method additionalModels() to add a model that I'd like to document. This model is not explicitly used by any endpoint.

Upon inspection of generated /v2/api-docs as well as swagger-ui.html I can confirm that this model is properly placed under the "definitions" property alongside all other models.

On the other hand ReDoc only seem to render the endpoints and their explicitly used models and responses. Can I somehow force ReDoc to render that one additional class? Like, for example, somehow referencing it in the API description?

I am not sure, but I thinks it's related to this issue. If that's the case and it's not possible at the moment with ReDoc - what would be a reasonable alternative with similar look and feel?

Upvotes: 1

Views: 2094

Answers (1)

RomanHotsiy
RomanHotsiy

Reputation: 5148

ReDoc author here. This is not yet possible in ReDoc but support for this will be added in the future.

I can't come up with a reasonable workaround at the current stage so stay updated by subscribing to the issue you referenced.

Upvotes: 1

Related Questions