Allow telling whether an Operation specifies security#11
Merged
wolfadex merged 2 commits intowolfadex:mainfrom Mar 4, 2025
Merged
Conversation
fe37dde to
c48edc8
Compare
Contributor
Author
|
@wolfadex if you want to avoid a major version bump, I guess I could mark |
Contributor
Author
|
There are probably other similar cases where being able to tell whether a list was specified is important - I haven't attempted to figure that out. |
adamdicarlo0
added a commit
to adamdicarlo0/elm-open-api-cli
that referenced
this pull request
Feb 19, 2025
When an operation does not include the `security` key, it means "use the value of the top-level `security` key." When an operation *does* specify `security`, its value overrides the top-level `security` value. We need to be able to tell these cases apart in order to support operations overriding the global security setting. Here's how the spec documents this, in its description of the `security` field, at https://swagger.io/specification/v3/#operation-object: > A declaration of which security mechanisms can be used for this operation. [...] This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.
eb7e5fc to
f749ac0
Compare
wolfadex
approved these changes
Mar 4, 2025
adamdicarlo0
added a commit
to adamdicarlo0/elm-open-api-cli
that referenced
this pull request
Mar 4, 2025
pete-murphy
pushed a commit
to pete-murphy/elm-open-api-cli
that referenced
this pull request
Mar 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an operation does not include the
securitykey, it means "use the value of the top-levelsecuritykey." When an operation does specifysecurity, its value overrides the top-levelsecurityvalue. We need to be able to tell these cases apart in order to support operations overriding the global security setting.Here's how the spec documents this, in its description of the
securityfield, at https://swagger.io/specification/v3/#operation-object: