DarkaOnLine / L5-Swagger

OpenApi or Swagger integration to Laravel
https://github.com/DarkaOnLine/L5-Swagger
MIT License
2.64k stars 394 forks source link

Disable "Try it out " for specific api end point #586

Closed balap777 closed 1 month ago

balap777 commented 7 months ago

Want to remove or disable the "Try it out" button for selective api end point. Your input will be really helpful

Thanks in advance

karunkshrestha commented 7 months ago

I don't know if you can disable it for a specific route but you can disable it for specific HTTP method.

  1. publish the view php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
  2. add the 'supportedSubmitMethods' paramter to the config.
            layout: "StandaloneLayout",
            docExpansion : "{!! config('l5-swagger.defaults.ui.display.doc_expansion', 'none') !!}",
            deepLinking: true,
            filter: {!! config('l5-swagger.defaults.ui.display.filter') ? 'true' : 'false' !!},
            persistAuthorization: "{!! config('l5-swagger.defaults.ui.authorization.persist_authorization') ? 'true' : 'false' !!}",
            supportedSubmitMethods: [],