-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Avro - issue generating when using externally defined custom types #190
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
hello @chvndb ; Using a non referenced avsc file is actually not supported by the parser (and i think also by the generator) because the parser actually parse only the avsc file used in the A Workaround is to use a single a single avsc file with all your avro references like
@derberg how to deal with some external references never referenced in a asyncapi.yml file ? |
oh, wait, you mean that |
yes exactly |
oh, I had no idea 😆 thanks! so yeah, at the moment AsyncAPI specification supports referencing through correct me if I'm wrong but this is not stopping this avro schema parser dereferencing in avro way? before converting from Avro to JSON Schema, dereferencing could take place, right? just like validation |
dereferencing ? i just know that the avro file contents are pushed by the generator ; the avro-parser can not know what avro files are used in the spec |
Would it be possible to provide a reference file that lists "external" avro files which then be used when compiling? |
i think this is not currently supported by the specification ; You can not use the above workaround with all your external avro structures delcared in the same avsc file ? |
nevermind, I meant resolving references, this |
This issue has been automatically marked as stale because it has not had recent activity 😴 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 ❤️ |
I guess this one be closed, there is nothing that could be addressed in schema parser to fix it |
@M3lkior sorry for the very late response. We in fact "solved" it by automatically inlining the Avro references into one avsc file, but this is far from ideal. We would still prefer a way of keeping the references and somehow tell the parser the dependencies. |
@chvndb as you can see, I have the same problem. |
@hguidetti well we created a parser that scans all our avsc files. If an avsc file contains a reference to another schema, the parser will fetch the content of that schema and paste the content inline into the original avsc. The output avsc files do not contain any references anymore and can then be used as input the asyncapi. I cannot share any code as it is proprietary, but it is a fairly simple script. It is annoying step that ideally would be done by the parser itself. |
OK Thanks a lot. |
@hguidetti oor you can use AVDL, which inlines references when transformed into AVSC. |
you would need to discuss with https://github.com/asyncapi/parser-js maintainers how to do it so that parser and avro schema parser supports what you need it is not trivial topic |
Describe the bug
When trying to generate html the follow error occurs:
How to Reproduce
file: ./src/eu.account.account-metadata.avsc
file: ./src/eu.account.account-created.avsc
file: ./src/asyncapi.yaml
command:
docker run --rm -it -v ${PWD}:/asyncapi asyncapi/generator /asyncapi/src/asyncapi.yaml @asyncapi/html-template -o /asyncapi/build
Expected behavior
The generator to correctly parse the custom Avro type
eu.account.AccountMetaData
and generate html with the specifications inline.Notes
When using avro-tools for example it can parse the avro schemas without a problem and generate java code. Is this a bug inn asyncapi or is this not supported?
The text was updated successfully, but these errors were encountered: