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

v3.1 Schema bugfix: Update URI fields to use uri-reference or uri where appropriate #2586

Merged
merged 3 commits into from
May 27, 2021

Conversation

jdesrosiers
Copy link
Contributor

Reported by #2584

The uri format was being used for all URIs. However, uri doesn't allow relative URIs. The format should be uri-reference for any URI that allows a relative URI. I went through the spec and the schema and made sure that every URI field is using the appropriate format.

I also fixed some things related to the schema tests. The "default" field of a server variable must be one of the values in the "enum" field. JSON Schema can't express that constraint, so I removed the tests. I also fixed a typo in file name.

@webron webron merged commit ecc6ef3 into OAI:main May 27, 2021
char0n pushed a commit to char0n/OpenAPI-Specification that referenced this pull request Jul 5, 2021
…re appropriate (OAI#2586)

* Fix typo in v3.1 schema tests

* Remove v3.1 schema test for server variable

JSON Schema can't express this constraint

* v3.1 Schema fix. $ref should be a uri-reference
davishmcclurg added a commit to davishmcclurg/OpenAPI-Specification that referenced this pull request Nov 20, 2023
`Server.url` and `Link.operationRef` both allow variable substitution
with {brackets}, which means they're not always valid URI references.

For example, the [current specification][0] shows
`https://{username}.gigantic-server.com:{port}/{basePath}` as a Server
Object `url`, but it's not a valid URI reference because the host
includes curly brackets.

[`operationRef`][1] similarly includes
`https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get`
as an example that isn't valid using the `uri-reference` format.

I looked into the other uses of `uri-reference` and they seemed ok.

Related:
- OAI#2586
- OAI#3235
- OAI#3256
- davishmcclurg/json_schemer#158

[0]: https://spec.openapis.org/oas/v3.1.0#server-object-example
[1]: https://spec.openapis.org/oas/v3.1.0#operationref-examples
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.

None yet

3 participants