spec icon indicating copy to clipboard operation
spec copied to clipboard

Clarification on URL and it's resolution rules

Open char0n opened this issue 4 years ago • 3 comments

Hello,

In the AsyncAPI 2.2.0 spec, there are multiple fields that have description containing: MUST be in the format of a URL. These fields include:

All URL fields

  • Info.termsOfService
  • Contact.url
  • License.url
  • ExternalDocumentation.url
  • OAuthFlow.authorizationUrl
  • OAuthFlow.tokenUrl
  • OAuthFlow.refreshUrl

Does MUST be in the format of a URL mean that these fields allow only absolute URL as defined by rfc3986 section 4.3? It looks like that from all the examples in spec and given that the only field inside spec that explicitly mentions relative URLs is Server.url field. So I'm assuming only absolute URLs are allowed here, am I right?

Server.url field

Server.url field looks like an exception to URL handling within the spec and claims that URL MAY be relative. I assume that being relative complies with rfc3986 section 4.2?


I'm doing a lot of assumptions here. It would be great to have this all specified explicitly so that there is not place for assumptions and different interpretations. I'm willing to issue a clarification PR after we discuss this further.

PS: why not allow all URL fields to be relative? If the URL is relative it will be resolved using one of the Server.url (after it has been resolved itself against location where the AsyncAPI document is being served) as a Base URL. If no Server Object is defined, then the Base URL is automatically resolved against the location where the AsyncAPI document is being served.

Thanks!

char0n avatar Dec 14 '21 09:12 char0n

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Apr 14 '22 00:04 github-actions[bot]

Hey, you did not come to community meeting and somehow it got lost, sorry. Stale bot to the rescue 🚀 😄

More details in JSON Schema -> URL shoudl be of uri format so RFC3986. You want it explicit in the spec markdown file too, right? IMHO it definitely makes sense, users should not be forced to check JSON Schema

derberg avatar Apr 20 '22 13:04 derberg

More details in JSON Schema -> URL shoudl be of uri format so RFC3986. You want it explicit in the spec markdown file too, right?

Yep, I expect the markdown file to be the single source of truth. I've created https://github.com/asyncapi/spec/issues/780 to make it explicit.

IMHO it definitely makes sense, users should not be forced to check JSON Schema

Cool, I've created a PR that remedies the unclarity.

char0n avatar May 04 '22 16:05 char0n

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Sep 02 '22 00:09 github-actions[bot]

Closing as https://github.com/asyncapi/spec/pull/782 has been merged to master as editorial change.

char0n avatar Sep 07 '22 15:09 char0n

:tada: This issue has been resolved in version 3.0.0-next-major-spec.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Sep 29 '22 06:09 asyncapi-bot

:tada: This issue has been resolved in version 2.5.0-next-spec.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Jan 31 '23 09:01 asyncapi-bot

Recent comments about the release from the bot were added by mistake. More details in https://github.com/asyncapi/spec/issues/899

derberg avatar Jan 31 '23 10:01 derberg