parser-js
parser-js copied to clipboard
Getting a validation error while attempting to parse a document points to a url that does not exist
Describe the bug
When trying to parse an invalid api through parser.parse(api)
, it spits out:
ParserError: There were errors validating the AsyncAPI document.
at Object.parse (<path>/node_modules/@asyncapi/parser/lib/parser.js:96:23)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
type: 'https://github.com/asyncapi/parser-js/validation-errors',
title: 'There were errors validating the AsyncAPI document.',
The url provided (https://github.com/asyncapi/parser-js/validation-errors) does not exist.
How to Reproduce
See above
Expected behavior
It should point to a page that explains the various validation errors
Welcome to AsyncAPI. Thanks a lot for reporting your first issue.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
@JQrdan thanks for bringing this up. This link is useless at the moment. The only place we could link to is https://github.com/asyncapi/parser-js/tree/master#error-types but I guess the best would be something like https://www.asyncapi.com/docs/parser-js/errors/validation-errors
I dug a bit more and noticed we write in JSDocs that validation errors are based on better-ajv-errors
package, but they aren`t 😅
@fmvilas I think this is somehow connected to the overall idea of improving errors in the parser by @magicmatatjahu -> https://github.com/asyncapi/parser-js/issues/119. This could be a good candidate for a pitch.
Absolutely agree that this issue is a great candidate for a pitch. I don't have much time left to write it but feel free to do jump in if you feel in the mood 🙏
@fmvilas yeah, not necessarily for this cycle 😉
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch thanks to Spectral. Pending to add a test.
cc @magicmatatjahu
Resolved by https://github.com/asyncapi/parser-js/pull/676
:tada: This issue has been resolved in version 2.0.0-next-major.11 :tada:
The release is available on:
Your semantic-release bot :package::rocket: