Ask a Question

Conditionally enable/disable swagger documentation for endpoints based on environment.

sam2011
New Member

Conditionally enable/disable swagger documentation for endpoints based on environment.

Team,

In our springboot project, we use springdoc-openapi for generating swagger documentation for controller endpoints.

Currently Swagger documentation from the server application gets populated once controller have the endpoint available.

This does not necessarily mean it’s available to be consumed by client or api consumer.

We have several endpoints that are available in controller, but not yet ready for client consumption.

So we are looking for options on how we can enable/disable swagger documentation for certain endpoints based on the spring profile (dev/uat/prod)

Could you please help me find a solution for this?

1 REPLY 1
hashanm
Occasional Visitor

I am facing the same issue, I also need to disable the specification in prod env.

cancel
Showing results for 
Search instead for 
Did you mean: