Forum Discussion

sam2011's avatar
New Member
2 years ago

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


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?