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
Allow resolution of external references on AsyncAPI file #782
Comments
I've produced a sample for such a case here: https://github.com/microcks/microcks/raw/1.7.x/webapp/src/test/resources/io/github/microcks/util/asyncapi/user-signedup-json-ref-asyncapi.yaml If you'd like to check, please import the file above using a regular importer job that connects to GitHub. It should discover the AsyncAPI schema as well as an additional JSON Schema. See capture below: You can check the microcks pod logs that should display the following messages where the relative reference is resolved at the moment you launched the import:
Also, when looking at the AsyncAPI contract, reference to the JSON schema that was components:
schemas:
UserSignedupEvent:
type: object
allOf:
- $ref: "User+signed-up+API-0.1.0-user-signedup.json" |
Reason/Context
As of today, we have a reference resolution mechanism that is used on import time for AsyncAPI spec file. This has been added in #306 in order to support Avro schema references. It also has been used later on for gRPC support addition (one protobuf file may referenced other external protobuf files).
referencing JSON Schema files from OpenAPI files is now a very common practice (though I personally think that you then have to be very cautious on how you manage versioning of everything 😉 )
Description
For unknown reasons, it hasn't been fully applied to AsyncAPI support yet as it has already been done for OpenAPI (see #548)
We should add this full reference resolution mechanism for AsyncAPI.
Implementation ideas
It means that references will be discovered at import time but I see options on how to implement it:
We'll implement
#3
that is the way things have been implemented in #548.The text was updated successfully, but these errors were encountered: