-
Notifications
You must be signed in to change notification settings - Fork 219
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 support for specifying multiple security requirement keys #813
Add support for specifying multiple security requirement keys #813
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice 👍 Just some minor things to check out and it is done.
@juhaku fixed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
Future support for duplicate name keys in |
Hi! The first contribution to this repo, so I may have missed some things.
I use
utoipa
in my project and I faced a problem of not being able to use multiple security requirement keys.As described in Swagger docs: Some REST APIs support several authentication types. The security section lets you combine the security requirements using logical OR and AND to achieve the desired result.
I made an issue. Then, I resolved it myself. Now you can use multiple security requirements separated by a comma in
#[utoipa::path]
. Example:Also, now you can construct those with
add()
method:I didn't change the names of already existing methods and types. Additionally, as you can see new
security(...)
syntax is compatible with the old one. So it isn't really a breaking change.Resolves #803. Resolves #717