-
-
Notifications
You must be signed in to change notification settings - Fork 211
-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
v1.10.0 does not support local files in $ref #963
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. |
@eivindga can you please paste the error that you're getting from the system? |
We are encountering multiple different error-messages:
Unfortunately, I am unable to share the complete asyncapi-file and the resource files, as this is an internal documentation site. But from my limited testing it seems it is no longer possible to include external:
when using local references. |
The reason you are getting these errors is that you are not allowed to have references there, i.e. what you have is indeed an invalid AsyncAPI document (this was a bug (but a feature for you I guess 😅) in the earlier version of the parser), see more here: asyncapi/parser-js#405 You are only allowed to have references where the type is marked as Otherwise, you will need some kind of pre-processing 🙂 |
Yikes! This will cause us a lot of work, not to mention a big headache maintaining this enormous asyncapi-file. 😕 Is there a known pre-processor we could use that would let us continue having resource files outside the asyncapi-yaml? |
This sounds like the perfect reason to suggest that we change the spec, and allow you to do this 🙂 Because you have the use-case for it. Because it would be a non-breaking change, it should be relatively easy to champion, what do you think about that? At least won't hurt to suggest it 🙂 There is no pre-processor, no, cause well, we haven't had this issue before now 😅 Maybe you can use the bundler: https://github.com/asyncapi/bundler 🤔 I, for example, use it myself as part of the release flow for AsyncAPI documents. So whoever uses the AsyncAPI document down the line (documentation, HTML generator, react component, etc) doesn't need to handle local references (I am using valid AsyncAPI documents however, not sure if it works for your case). But yea, I would definitely suggest the change in the spec itself anyway, cause then it will no longer be an invalid AsyncAPI document 😄 |
Closing as it is not generator related. It must be first fixed in the spec, then by default it will be fixed in parser, and automatically will be fixed in generator without any special action |
Describe the bug
The latest version of the parser does not support '$ref' used anywhere in asyncapi-files, referencing local files when generating doc.
How to Reproduce
Try to include a local file using ref in:
Example of message:
Expected behavior
Latest version should work in the same way as v1.9.18.
The text was updated successfully, but these errors were encountered: