Skip to content
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

Throw meaningfull error when parser of specific schemaFormat is not available #157

Closed
Tracked by #481
derberg opened this issue Aug 10, 2020 · 17 comments
Closed
Tracked by #481
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@derberg
Copy link
Member

derberg commented Aug 10, 2020

Describe the bug

We do not check if there is a parser available for a given custom schemaFormat and throw not meaningful error that PARSERS[String(...)] is not a function

Hint: this is where we trigger parsers and we need to validate if the function is really there -> https://github.com/asyncapi/parser-js/blob/master/lib/parser.js#L179

How to Reproduce

Just try to parse the spec with payload defined with some openapi/raml/avro schema. Without registering schema parsers for those schema formats.

Expected behavior

In my opinion we need to add new error type and document it in the readme too https://github.com/asyncapi/parser-js#error-types

How about: schema-parser-not-registered? with detail property that indicates exactly what message has this problem? and of course exact location of the error in the file.

Bonus would be to have an idea how to tell the user that for some schemas there are parsers, and where they can find them

@derberg
Copy link
Member Author

derberg commented Oct 1, 2020

video about the issue https://youtu.be/Iqs_2BiNEEo?t=1857

@github-actions
Copy link

github-actions bot commented Dec 1, 2020

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Dec 1, 2020
@derberg derberg removed the stale label Dec 1, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions
Copy link

github-actions bot commented Jun 1, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label Jun 1, 2021
@derberg derberg removed the stale label Jun 1, 2021
@github-actions
Copy link

github-actions bot commented Aug 1, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@ritik307
Copy link

Hi @derberg I would like to work on this issue

@derberg
Copy link
Member Author

derberg commented Jan 17, 2022

@ritik307 go ahead man, make sure to look into previous PR, there was already a lot of work done that you can reuse afaik

@ritik307
Copy link

@ritik307 go ahead man, make sure to look into previous PR, there was already a lot of work done that you can reuse afaik

Sure will look into them 😁

@ritik307
Copy link

ritik307 commented Jan 18, 2022

@derberg I am facing an error in lib/parser.js while setting up the project to the point where the last PR was made. I have added everything that was done in the last PR. While testing the code after completing the changes I face the following issue:-

ss1

I replaced it with the defaultSchemaFormat function and all my test cases passed.

ss1

So is it the correct way to resolve the error or am I doing something wrong here?

@derberg
Copy link
Member Author

derberg commented Jan 18, 2022

@ritik307 please open up a Draft PR as it will be much easier to see all the changes that you did and ineract there on specifics 🙏🏼

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added stale and removed stale labels Sep 17, 2022
@magicmatatjahu
Copy link
Member

magicmatatjahu commented Oct 25, 2022

Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch in https://github.com/asyncapi/parser-js/blob/next-major/src/schema-parser/index.ts#L34 line - but we probably need to wait for PR for v1 ParserJS #449

What do you think, should we close it or should we wait for #449 PR?

cc @derberg @ritik307

@derberg
Copy link
Member Author

derberg commented Oct 25, 2022

up to @ritik307 if he can continue. Otherwise close I guess

@magicmatatjahu
Copy link
Member

Ok @ritik307 I will wait max 2 weeks for your response and in the case without response I will close this one.

@magicmatatjahu
Copy link
Member

I am closing due to lack of response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants