spec icon indicating copy to clipboard operation
spec copied to clipboard

[BUG] Server Object field "url" description is inaccurate

Open gibson042 opened this issue 5 years ago • 9 comments

Describe the bug The AsyncAPI specification says about the Server Object url field that it contains a URL and "MAY be relative", but then uses as an example value "development.gigantic-server.com". This is not an (absolute) URL because it lacks a colon-terminated scheme such as "https", but if interpreted as a relative reference then the result will be something like "https://example.com/example-service/asyncapi.json/../development.gigantic-server.com" (specifically because "a relative reference that does not begin with a slash character is termed a relative-path reference" and inherits the authority component and path prefix of its base URI, cf. RFC 3986 section 4.2 and section 5.2.3).

To Reproduce Steps to reproduce the behavior:

  1. Navigate to https://www.asyncapi.com/docs/specifications/2.0.0/#serverObject or https://www.asyncapi.com/docs/specifications/1.2.0/#serverObject, or their respective git snapshots (2.0.0, 1.2.0).
  2. Observe that url is a URL and "MAY be relative", but the absence of text allowing it to be a bare host name (or IP address, for that matter) despite the use of an example value that looks like one.

Expected behavior Presumably the intent is to interpret values matching the RFC 1034 section 3.5 preferred name syntax as updated by RFC 1123 section 2.1 (i.e., non-address strings matching the regular expression pattern ^[a-zA-Z0-9]+(-+[a-zA-Z0-9]+)*(\.[a-zA-Z0-9]+(-+[a-zA-Z0-9]+)*)*$) as the host component of a URL with default scheme and path (e.g., "https://{value}/") and use the relative reference treatment only as a fallback. If so, the description should be updated accordingly.

And if there is also a desire to allow not just host names but also IP addresses, that should be documented as well.

Sample document n/a

Screenshots n/a

Additional context n/a

gibson042 avatar Sep 23 '19 23:09 gibson042

Hey @gibson042! Thanks for reporting the bug. I think the problem is actually with the example. It should probably use tcp:// or kafka:// (not sure this one is valid). I don't think we should specify that IP addresses are allowed. They are because they can be part of a URL. I agree we could probably add an example using an IP address.

fmvilas avatar Sep 30 '19 09:09 fmvilas

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 29 '19 09:11 stale[bot]

This is still relevant, it just lacks a clear path to resolution.

gibson042 avatar Nov 29 '19 14:11 gibson042

My suggestions to resolve:

  1. Update all examples to use URLs that include scheme.
  2. Add an additional example to illustrate how the server URL is determined when relative URLs are used and consider clarifying the language here.

nickspacek avatar Dec 04 '19 15:12 nickspacek

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 02 '20 15:02 stale[bot]

Is there any of you who wants to champion this? 🙂 Or can we consider this issue as needs champion? 🤔

jonaslagoni avatar Jan 19 '22 18:01 jonaslagoni

Can we say that this one is superseded by https://github.com/asyncapi/spec/issues/547 ?

dalelane avatar Jan 23 '22 20:01 dalelane

@dalelane definitely we can accept both 😄 I think you are right and better to just continue with #547

derberg avatar Jan 24 '22 16:01 derberg

Yeah, I should have been clear on #547 that it's actually a proposal to fix this issue. Updating it. Thanks!

fmvilas avatar Jan 24 '22 18:01 fmvilas

The proposal now moved to RFC 1 stage: https://github.com/asyncapi/spec/pull/888. Have a look!

fmvilas avatar Dec 17 '22 10:12 fmvilas