Skip to content
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

Treat security scheme as case insensitive in JSON schema [Issue #2703] #2706

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

hornworm61
Copy link
Contributor

@hornworm61 hornworm61 commented Sep 9, 2021

Addresses #2703

This change updates the JSON Schemas for both 3.0 and 3.1 to allow for the security scheme to be case insensitive when checking for whether the bearerFormat propery is allowed.

@jdesrosiers
Copy link
Contributor

@hornworm61 I'm doing final checks before releasing the new version of the schema and I noticed that you removed required: [scheme] from the http type. This doesn't look correct. Did you remove this on purpose?

jdesrosiers added a commit to jdesrosiers/OpenAPI-Specification that referenced this pull request Sep 28, 2021
jdesrosiers added a commit to jdesrosiers/OpenAPI-Specification that referenced this pull request Sep 28, 2021
@jdesrosiers
Copy link
Contributor

@webron No, that required is in the if schema. It's only used to determine whether or not to apply the then schema.

@hornworm61
Copy link
Contributor Author

I think the type-http-bearer subschema originally said: "If the object has a property 'type' of 'http' and a 'scheme' of 'bearer' then it is allowed to have a property of bearerFormat and must have a property 'scheme'

But if the object passes the if part of this, then it definitely has a property 'scheme', so the "required" portion of the then branch is redundant because it can never fail.

Also, the type-http subschema already says that if the object has a property 'type' of 'http' then it must have a property of 'scheme' (and type-http and type-http-bearer are used in an "all-of" construct).

@jdesrosiers
Copy link
Contributor

the type-http subschema already says that if the object has a property 'type' of 'http' then it must have a property of 'scheme'

Ahh, yes, you're right. That's what I was missing.

jdesrosiers added a commit to jdesrosiers/OpenAPI-Specification that referenced this pull request Sep 29, 2021
webron pushed a commit that referenced this pull request Oct 7, 2021
* Update 3.1 schema id for patch release

* Generate JSON for new version of 3.1 schemas

* Catchup v3.0 schema with #2158

* Catchup v3.0 schemas with #2673

* Catchup v3.0 schemas with #2706

* Update schema id for 3.0 release
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.

4 participants