-
Notifications
You must be signed in to change notification settings - Fork 280
Description
The OAS specifies the operation level security object as follows:
A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.
The overriding with a empty array seems to be a problem when creating the OpenApiDocument from a Swagger 2.0 / OAS string as it gets deserialized into a empty list thus removing the information that the operation should override the security defined on the top level.
Example of operation level security that does not override the top-level one:
"security": []
Example that does override it but does not follow the spec
"security": [{}]