-
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
Drop uri-reference
format for template URLs
#3455
Conversation
`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
Thanks, @davishmcclurg ! This is more or less a duplicate of #3235, which got a bit bogged down in questions over what format to use (and add to the format registry) for these things. @MikeRalphson it might be good to go ahead and accept this one to at least stop implementations that try to enforce the existing format from breaking on this. Assuming we can actually work out the logistics of publishing a schema update soon. |
Temporary fix until upstream schemas are fixed and published: OAI/OpenAPI-Specification#3455 Closes: #158
This also enables support for IDNs. Current format "uri-reference" does not allow them. If not considering variables, at least "iri-reference" should be used instead. |
@ekzobrain OAS 3.x does not have direct IRI support (I am hopeful it will be in OAS 4 "Moonwalk"). IRIs are only supported by being encoded down to URIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth merging this even though there's another PR that overlaps with it. This one is simpler. Although we still need to solve the schema deployment issues discussed in #151.
Thanks for this! I just ran into this issue when implementing servers url matching in my implementation. It would be good to see this published so I can make use of it :) |
Server.url
andLink.operationRef
both allow variable substitution with {brackets}, which means they're not always valid URI references.For example, the current specification shows
https://{username}.gigantic-server.com:{port}/{basePath}
as a Server Objecturl
, but it's not a valid URI reference because the host includes curly brackets.operationRef
similarly includeshttps://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get
as an example that isn't valid using theuri-reference
format.I looked into the other uses of
uri-reference
and they seemed ok.I'm not sure how to update the actual JSON schemas but readme says to just update the yaml files, so let me know if there's anything else to do.
Related: