I am working on a spring boot 3.1.4 (java 17) project with the following dependency:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
</dependency>
I create through configuration files the OpenAPI definition and 5 GroupedOpenApi beans. I also use some annotations to enrich my OpenAPI with operations and schemas.
I use both Redoc (static html template) and Swagger UI (from the above dependency). Redoc is for public / external use and Swagger UI for internal.
So far so good, especially for Redoc, since I have a separate html template per group.
What I want is to render only the 3 out of 5 GroupedOpenApi defined beans in the Swagger UI dropdown. I can't remove or make conditional the other 2 since they are used from Redoc.
I tried the following:
springdoc.api-docs.groups.enabled
property but after some investigation this property does not exist anymore -> Raised a documentation issuespringdoc.swagger-ui.urls[]
but it appends instead of overridingurls
in AbstractSwaggerUiConfigProperties
upon server startup (postConstruct of the application) and with a request filter (before and after the http request to /swagger-ui/index.html) but it still renders all the 5 GroupedOpenApiThanks in advance
I solved the issue by creating a simple swagger-config.json
which includes only the swagger-ui.urls[]
that I want and configured in application.yml
the property springdoc.swagger-ui.configUrl
to point to my file