-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Global @security support #407
Comments
The context doesn't apply all the time: I recently wrote a API that have 2 different security mechanisms for admin and user side. If we go on this path , we can also setup a default @accept and @produce , @failure XXX and when a new developer will take a into documentation and code will start wondering where they came from . I personalty don't see it's as a feature. |
The global @Security tag is supported by specs 2.0. It certainly helps for swift developing. Hope you guys could add this feature later. |
Any progress on this? Simply parse the @Security comment in global scope will do |
how |
my problem was calling Might be good to give a warning if certain fields aren't set |
Any progress? |
@liuzou1991 This is an Open Source project, and any contribution is welcome. |
There is actually a problem in Postman by excluding this functionality. Without a global security directive, Postman sets the API to "No Auth" at the root level. While not a Swagger problem, it becomes a problem when other providers rely on the full Swagger spec to be implemented. If I have time I can look through and see what fix would be possible. |
@ubogdan Is there any documentation on the flow within the code? |
Is your feature request related to a problem? Please describe.
It's cumbersome to specify
@Security
on every controller if the entire API requires the same authentication mechanism.Describe the solution you'd like
Something like below on the global context
Describe alternatives you've considered
Can't think of a fair alternative to this
Additional context
It's quite common for internal API application to use a global authentication mechanism. Would be great if it can be added.
If you think this request is applicable and needs help, I can work out a PR later.
Thank you for providing such a great tool ❤️
The text was updated successfully, but these errors were encountered: