I'm trying to disable the Swagger UI, or more precisely, because I want us to provide it only for non-production environments.
I referenced this link, but nothing happened.
My api_platform.yaml
File:
api_platform: defaults: route_prefix: '/%env(API_ROUTE)%' enable_docs: false enable_entrypoint: false enable_swagger_ui: false swagger: api_keys: JWT: name: Authorization type: header collection: pagination: enabled: true
P粉7294365372024-04-05 10:12:42
api_platform: defaults: route_prefix: '/%env(API_ROUTE)%' swagger: api_keys: JWT: name: Authorization type: header collection: pagination: enabled: true when@prod: api_platform: enable_docs: false enable_entrypoint: false enable_swagger_ui: false
Your api_platform.yaml will look like this. If you use the environment correctly then your swagger will only be disabled in your production environment.