parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

Getting a validation error while attempting to parse a document points to a url that does not exist

Open JQrdan opened this issue 4 years ago • 8 comments

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

JQrdan avatar Jan 12 '21 15:01 JQrdan

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.

github-actions[bot] avatar Jan 12 '21 15:01 github-actions[bot]

@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.

derberg avatar Jan 13 '21 09:01 derberg

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 avatar Jan 13 '21 16:01 fmvilas

@fmvilas yeah, not necessarily for this cycle 😉

derberg avatar Jan 13 '21 19:01 derberg

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:

github-actions[bot] avatar Mar 15 '21 00:03 github-actions[bot]

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:

github-actions[bot] avatar May 15 '21 00:05 github-actions[bot]

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:

github-actions[bot] avatar Jul 17 '21 00:07 github-actions[bot]

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:

github-actions[bot] avatar Sep 18 '21 00:09 github-actions[bot]

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

smoya avatar Oct 25 '22 09:10 smoya

Resolved by https://github.com/asyncapi/parser-js/pull/676

magicmatatjahu avatar Nov 15 '22 07:11 magicmatatjahu

: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:

asyncapi-bot avatar Dec 13 '22 11:12 asyncapi-bot