emsifa / evo

Evolve your Laravel code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenAPI generate wrong security schema

emsifa opened this issue · comments

configs/evo.php:

'security_schemes' => [
    'sanctum' => [
        'type' => 'http',
        'scheme' => 'bearer',
    ],
],

Controller:

#[Get('something')]
#[UseGuards('sanctum')]
public function getSomething(): GetSomethingResponse
{

}

Generated security on GET /someting operation:

{
    "0": {
        "sanctum": [ ]
    },
    "sanctum": {
        "key": "sanctum",
        "names": [ ]
    }
}

Expectation:

Generated security should be like this:

[
    { "sanctum": [] }
]