-
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
Errata and/or Spec Clarification Required for Security Scheme Object (OAS 3.0 and OAS 3.1) #2703
Comments
From #1876 (comment):
So if that means that
to something like
|
Sounds right (in both the positive and negative branches of the oneOf). |
PR: #2706 |
PR was merged! Closing. |
(This applies to both 3.0 and 3.1, but I'm referencing 3.1 sections)
Section 4.8.27 defines the "scheme" field of the Security Scheme Object as "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry."
It isn't clear whether this field is case-insensitive. RFC7235 implies that in the context of the Authorization header, the value is case insensitive, but it is confusing whether it is also case insensitive here. The IANA Authentication Scheme registry defines several values, including "Basic" and "Bearer" with an initial upper case character in each case. The examples in the OAS use "basic" and "bearer", which does imply that is should be case-insensitive in this context as well.
But confusing matters further in the OAS for Security Scheme Objects is the definition of "bearerFormat", which implies that it is valid only if "scheme" is "bearer". The official JSON Schema for OpenAPI files only allows "bearerFormat" if the scheme is literally "bearer". Should it not also be valid is the scheme is "Bearer" (or any other combination of upper and lower case characters)?
Specifically, the following OpenApi fragment does not pass schema validation, but I believe the specification implies that it should be OK:
Some words of clarification in the specification would be helpful, as well as a confirmation that the JSON Schema is either correct or is in error.
For reference, the JSON Schema that fails this is:
The text was updated successfully, but these errors were encountered: