-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Dereferencing rules #579
Comments
@char0n Hi! I think that this sentence points to logic how it works in the JSON Schema ( |
@char0n Do you have any suggestions to improve the description of dereferencing rules? |
Hi @magicmatatjahu,
How it works in JSON Schema is completely different how Reference Object works in AsyncApi spec. That's my whole point. This is why this sentence is confusing for the reader and opens door for different interpretations.
In AsyncApi, referencing is defined exclusively by Reference Object and not by JSON Schema rules. Even JSON Schema uses Reference Object to process references and transclution. I've already provided my suggestion in my first comment: I'd replace this sentence:
with the following one:
If agreed I can issue a PR. |
I've issued a PR with the clarification: #602 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
Attached PR has been merged, closing this. |
Hello everybody,
This issue is specifically about AsyncApi 2.0.0, but applies to v2.1.0 respectively. I'm working on a dereferencing tool a bumped to another issue regarding JSON Schema dereference. We've already stipulated in #552 that whenever the
$ref
field is intercepted inSchema Object
, this Schema Object becomes aReference Object
and not aSchema Object
with$ref
keyword. This effectively means that dereference is purely guided using rules aroundReference Object
.Never the less, the File Structure section contains following sentence:
The interesting part is the second (last) sentence. It's not very clear what this sentence actually tries to tell us.
There can be two possible interpretations (that I can see):
$ref
fields follow rules around JSON Schema dereferenceAs stipulated in #552 this in not true.
$ref
fields supports only referencing JSON SchemasAgain this in not true.
$ref
field can only be present (and have semantics) inReference Object
andReference Object
can reference other specification objects (Security Scheme, Parameter, Message, etc..).IMHO this sentence mandates a major change in wording to clarify it's true meaning.
We can take inspiration from OpenApi 3.1:
An AsyncAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the author. In the latter case, Reference Objects are used.
The text was updated successfully, but these errors were encountered: