core icon indicating copy to clipboard operation
core copied to clipboard

[Laravel ] swagger UI is showing padlock (authorization btn) on every endpoint there exists.

Open developer2021cat opened this issue 8 months ago • 1 comments

Description
swagger UI is showing padlock on every endpoint there exists.

Example
api-platform.php 'swagger_ui' => [ 'enabled' => true, 'persist_authorization' => true, 'apiKeys' => [ 'api' => [ 'type' => 'header', 'name' => 'Authorization', ] ] },

ApiResource

`#[ApiResource( operations: [ new Post( uriTemplate: '/login', controller: AuthController::class,

    ),
],

)]`

in route login swagger show authorization btn (icon padlock) too , How i config in ApiResource route /login to remove padlock .

developer2021cat avatar Jun 03 '25 11:06 developer2021cat

If it works the same way for Laravel integration as it does for Symfony, you would add the openapi parameter into your operations, setting security to an empty array, e.g.

new Post(
    openapi: new Operation(
        security: [],
    ),
   ...
)

dwgebler avatar Jun 09 '25 16:06 dwgebler

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 08 '25 16:08 stale[bot]