-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
JRI from an AsyncAPI perspective #17
Comments
Thanks, @jonaslagoni - let's start with:
I assume "produce" here means removing all references and replacing them with their targets in some way. This is not possible with cyclic references. Are you just trying to remove all of the non-JSON Schema references because they are guaranteed to not be cyclic? What exactly is driving the need to produce a valid JSON document (which can then be parsed and loaded into memory like any other JSON document) vs being able to load the original document(s) into a usable in-memory representation mixing JSON and non-JSON values in a way that is clear while traversing the data-structure? If you resolve non-JSON reference targets to a string that is embedded into a JSON file, then when you parse that JSON file you will need to know that the string in that spot requires further parsing and interpretation. So with either approach, you need to know when and how to handle that bit of in-memory data. This feels a bit to me like a tension between |
It was to emphasize that the referencing standard takes it's root in JSON (cause that's what you write the AsyncAPI file in), so naturally the referencing standard (as JSON Reference) should work within that restriction, even though you might reference something that is not.
Nothing is guaranteed, while something like protobuf does not support circular types, XSD does.
It comes from an implementation point of view, and specifically these two cases come to mind:
|
@handrews do correct me if I am wrong in any of the cases 😆
Defined by https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#general-syntax
Same as JRef, this is decided per media type, and explicitly allow the context specification to determine the behavior, any of the above use-cases seem to be covered.
https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#extending-jri-extending
https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#standalone-jri-implementations
https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#avoiding-behavioral-overlap
Everything is context aware, and is dynamic based on media type, i.e. resolving references in a JSON Schema context follows different rules for
$ref
then in the context specification of JRI.https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#fragments-and-secondary-resources defines the behavior for fragments and secondary resources.
https://github.com/json-schema-org/referencing/blob/main/draft-handrews-jri.md#discovering-caching-and-serving-resources-serving defines the behavior for caching and bundling.
Context specifications take priority, which clears up the confusion.
The text was updated successfully, but these errors were encountered: