-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Having invalid examples in spec fails CLI build #994
Comments
Sharing this Slack thread that adds more context and shows the consequences of this issue https://asyncapi.slack.com/archives/CQVJXFNQL/p1702376239408029?thread_ts=1702289410.144129&cid=CQVJXFNQL |
The issue is related with this line https://github.com/asyncapi/cli/blob/7259f7c71060b86529028463c3998568adb15457/scripts/fetch-asyncapi-example.js#L73C9-L73C9 In the case the parser cant parse a document, The point here is that a decision must be taken about erroring (quitting the app with an error message) when that happens or rather skip the example. The second option is what the code is supposed to be doing, however we would need to avoid adding that null value to the final array somehow (this is part of the task to solve this). Considering that all examples should be valid if asyncapi/spec#957 moves forward, I would say we go with the second option. |
I would like to implement this |
For the record, the following conversation is happening: https://asyncapi.slack.com/archives/CQVJXFNQL/p1702544253816909?thread_ts=1702289410.144129&cid=CQVJXFNQL |
🎉 This issue has been resolved in version 1.2.31 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
A clear and concise description of what the bug is.
The script that CLI runs in its build process fetches examples from the spec repository, If any example in the spec is invalid the
examples.json
file that is being created by the script creates a null value in the script and thus the build fails. Even older versions of the CLI start having issues due to this.How to Reproduce
The only way to reproduce is if we have an invalid example in the spec repository or by copy/pasting this
example.json
file.Expected behavior
If we have any invalid example we should not generate the
example.json
with a null value.The text was updated successfully, but these errors were encountered: