-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Shared avro model results in incorrect AsyncAPI document #1075
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. |
This issue is probably a duplicate of asyncapi/avro-schema-parser#190 |
I understand that for asyncapi/avro-schema-parser#190 it not at avro-schema-parser level, maybe there is anything to do at generator level ? Would it be possible to have a kind of Model Store ? So if I have a reference to com.example.Address, it will find the model. The dependency tree has to be determined first and then the model must be treated in the correct order (from the less dependent to the most ones). |
@hguidetti there is not much we can do on generator level. Generator 100% relies on AsyncAPI object provided by https://github.com/asyncapi/parser-js. The parser is the tool where something like what you need could be provided - not sure how though. Maybe concept of custom schema parser should be extended to allow owners of parsers like anyway, definitely nothing we can do in generator other than use what parser provides. please open a separate issue in Parser with full explanation of problem. I will close this issue for now |
Describe the bug
Hello,
I have an AsyncAPI file that uses referenced Avro schemas. One schema is shared between 2 referenced schemas.
In my example, I have a User and a Pet which both have an Address that is referenced in the avsc file using
When I generate the documentation (for example), I receive an error
Generator Error: Input is not a correct AsyncAPI document so it cannot be processed.
How to Reproduce
I have created a little example on my GitHub https://github.com/hguidetti/asyncapi-avro-shared-model to reproduce.
Run
generate-correct.sh
to verify that the generation works correctly. (I used latest version of the Docker image asyncapi/cli but with HTML template @0.28.4 to work around asyncapi/html-template#456)Run
generate-wrong.sh
to see that the generator sendsGenerator Error: Input is not a correct AsyncAPI document so it cannot be processed.
I also tried with VS Code and the AsyncAPI plugin and it doesn't work neither. I receive the error
Error: undefined type name: com.example.Address
Expected behavior
The AsyncAPI should be correct. (Or do I do anything wrong ?)
The text was updated successfully, but these errors were encountered: