Uh oh!
There was an error while loading. Please reload this page.
Note relative URL-reference resolution ambiguity - #4130
Conversation
This explicitly lists out the cases and notes which ones were (as far as we can recall) intended to behave like `$ref`, but could be reasonably read to behave like API URLs.
mikekistler
left a comment
There was a problem hiding this comment.
Looks good! 👍
I think the wording as is conveys the key information, but I left an alternate wording that I think might read better in the spec. I'll leave it up to you if you prefer the original text.
| The wording above is intended to distinguish between API URLs (which use the Server Object to determine the base URI or the prefix for the URL path template), and OAD URLs (which use the current document's base URI per RFC3986). | ||
| However, only `$ref` was mentioned explicitly in versions 3.0.0 through 3.0.3 of this specification, leaving the behavior of the following fields ambiguous: the `operationRef` field of the [Link Object](#link-object), the URI form of the `mapping` field of the [Discriminator Object](#discriminator-object), the `externalValue` field of the [Example Object](#example-object), and the `url` fields of the [External Documentation](#external-documentation-object), [Contact](#contact-object), and [License](#license-object) Objects. | ||
| Therefore, which of the above two rules is used for each of these fields is _implementation-defined_, although it is RECOMMENDED to use the `$ref` process for all of them for compatibility with future versions of this specification. | ||
There was a problem hiding this comment.
How about this slightly more concise wording:
| The wording above is intended to distinguish between API URLs (which use the Server Object to determine the base URI or the prefix for the URL path template), and OAD URLs (which use the current document's base URI per RFC3986). | |
| However, only `$ref` was mentioned explicitly in versions 3.0.0 through 3.0.3 of this specification, leaving the behavior of the following fields ambiguous: the `operationRef` field of the [Link Object](#link-object), the URI form of the `mapping` field of the [Discriminator Object](#discriminator-object), the `externalValue` field of the [Example Object](#example-object), and the `url` fields of the [External Documentation](#external-documentation-object), [Contact](#contact-object), and [License](#license-object) Objects. | |
| Therefore, which of the above two rules is used for each of these fields is _implementation-defined_, although it is RECOMMENDED to use the `$ref` process for all of them for compatibility with future versions of this specification. | |
| Resolution of relative references in the `operationRef` field of the [Link Object](#link-object), the URI form of the `mapping` field of the [Discriminator Object](#discriminator-object), the `externalValue` field of the [Example Object](#example-object), and the `url` fields of the [External Documentation](#external-documentation-object), [Contact](#contact-object), and [License](#license-object) Objects is _implementation-defined_. For compatibility with future versions of this specification, It is RECOMMENDED to use the same process as $ref, but MAY instead use the URLs defined in the [Server Object](#server-object) as a Base URI, as either interpretation was possible in previous versions of this specification. |
There was a problem hiding this comment.
@mikekistler I like most of the wording change but want to tweak it a bit further- will update shortly.
Waiting for @handrews' improvements
Co-authored-by: Mike Kistler <mikekistler@microsoft.com>
handrews
commented
Oct 11, 2024
@mikekistler see how you like this latest change. I kept most of your deletions, but decided to entirely drop mention of previous drafts, and kept wording that highlights two important points:
|
handrews
commented
Oct 14, 2024
Two TSC approvals, so I'm hitting the merge button. |
This explicitly lists out the cases and notes which ones were (as far as we can recall) intended to behave like
$ref, but could be reasonably read to behave like API URLs.See: