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

Add global security annotation #1453

Open
cwansart opened this issue Jan 26, 2023 · 1 comment
Open

Add global security annotation #1453

cwansart opened this issue Jan 26, 2023 · 1 comment

Comments

@cwansart
Copy link

Is your feature request related to a problem? Please describe.
Our API is always using authentication for all routes, so we want to use global security definition described in https://swagger.io/docs/specification/2-0/authentication/basic-authentication/

Describe the solution you'd like
I want to add
// @Security BasicAuth
somewhere central (beneath // @securityDefinitions.basic BasicAuth?)
so that

security:
  - basicAuth: []

gets added to the root resulting json/yaml file.

Describe alternatives you've considered
So far I had to add // @Security BasicAuth to every @router element.

Additional context
Not much else to show I guess.

@1000Reasons
Copy link

Did you manage to get this working @cwansart ? I have a similar use case but adding the @security header beneath my @securityDefinitions.apiKey ApiKeyAuth isn't working 🤔

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

2 participants