-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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 security to the components object #1850
Comments
You could define the security constraints in the root object and then override it on a per operation basis where necessary. |
True, but the |
@djpadz Yes, but most other components don't have top level objects that apply globally. Having an API where the security schemes vary significantly across the API doesn't seem like desirable behavior. Having an anonymous API with some specific operation auth'd seems normal, or the opposite where it is secured but with some anonymous exceptions seems normal. Can you tell us more about your use case where you want to vary the types of auth allowed across your API? Our concern is about adding unnecessary complexity. |
In my particular use case, adding the security definition to the top level would work. The thought was more about allowing |
Consolidating under #3853 and closing |
Consider this snippet:
If I want a set of requests to support each of these authentication methods in turn, I would have to add something like:
...to each one. It would be far easier if the
components
object supported asecurity
section, something like this:...so that requests could just include:
The text was updated successfully, but these errors were encountered: