Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example global 'security' config is wrong #314

Closed
adamk33n3r opened this issue Aug 20, 2020 · 0 comments
Closed

Example global 'security' config is wrong #314

adamk33n3r opened this issue Aug 20, 2020 · 0 comments

Comments

@adamk33n3r
Copy link

  • L5-Swagger Version: 8.0.0 (composer show | grep l5-swagger)
  • PHP Version (php -v): 7.2.24
  • OS: Ubuntu 18.04

Description:

The example security config is as follows

'security' => [
                /*
                 * Examples of Security
                */
                /*
                'oauth2_security_example' => [
                    'read',
                    'write'
                ],
                'passport' => []
                */
            ],

But it should be

'security' => [[
                /*
                 * Examples of Security
                */
                /*
                'oauth2_security_example' => [
                    'read',
                    'write'
                ],
                'passport' => []
                */
            ]],

The 'security' config option needs to be an array not an object. When trying to set a global security I did the following

'security' => [
    'api_key' => []
]

but this did not work. the "Available authorizations" dialog was empty. I had to do this

'security' => [
    ['api_key' => []]
]

which makes sense, because in the docblock, you have to do

     *      security={
     *          {"api_key"={}}
     *      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant