Skip to content

v3.3: define an explicit default for the top-level "security" object - #5536

Open
karenetheridge wants to merge 1 commit into
OAI:v3.3-devfrom
karenetheridge:ether/v3.3-security-requirement-default
Open

v3.3: define an explicit default for the top-level "security" object#5536
karenetheridge wants to merge 1 commit into
OAI:v3.3-devfrom
karenetheridge:ether/v3.3-security-requirement-default

Conversation

@karenetheridge

Copy link
Copy Markdown
Member

Similar to the "servers" default, this does not change any functionality; it only adds clarity.

(I'm on the fence as to whether this should/could go into v3.2.)

  • schema changes are included in this pull request

Similar to the "servers" default, this does not change any functionality; it
only adds clarity.
@karenetheridge
karenetheridge requested review from a team as code owners September 7, 2026 23:29

@mikekistler mikekistler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have concerns about this change.

Comment thread src/oas.md
Comment on lines +105 to +106
| <a name="oas-security"></a>security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. 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. Individual operations can override this definition.
If the `security` field is not provided, or is an empty array, the default value would be an array consisting of a single Security Requirement Object with no properties (`[{}]`), which indicates that security is optional. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am uncomfortable with this change, as it seems to change the meaning of an OpenAPI description that does not have a security field in an "Open World" interpretation of OpenAPI (which I think is how we want OpenAPI descriptions to be interpreted).

From [Is OpenAPI an Open World or a Closed World Contract?](#568):

In an open world we cannot make assumptions about what is not described.

So if security is not provideed/described, we cannot make assumptions about it -- including about whether it is optional or required. It may very well be required and simply not described.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it already described that "no security" is the default, in the absence of any security specification? That is: how would an implementation's behaviour change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants