-
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
fix: update format for servers.url and links.operationRef in v3.1 schema #3235
Conversation
uri-reference is not the right format for these properties, as they can contain unescaped { and } characters. As @jdesrosiers points out, they are not uri-template either, as they do not support RFC6570 URI templates in full.
can't |
@handrews yes, but does that mean it requires a new |
@MikeRalphson it depends on what you want tooling to be able to do with the It's hard for me to judge whether this But really, if all you want this to do is indicate " |
See also #3256 (Formally define templating behavior) |
`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
While I agree that we need to do something like this, I'm going to close this particular PR so that:
We can open a new PR for this once the number and name of formats is resolved. |
`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/OpenAPI-Specification#2586 - OAI/OpenAPI-Specification#3235 - OAI/OpenAPI-Specification#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 (cherry picked from commit 5f765f29e3c12dcab370f5155fe21c6895a8ac5e)
uri-reference
is not the right format for these properties, as they can contain unescaped{
and}
characters. As @jdesrosiers points out, they are noturi-template
either, as they do not support RFC6570 URI templates in full.