Throw meaningfull error when parser of specific schemaFormat is not available
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
video about the issue https://youtu.be/Iqs_2BiNEEo?t=1857
This issue has been automatically marked as stale because it has not had recent activity :sleeping: 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 :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:
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:
Hi @derberg I would like to work on this issue
@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 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 😁
@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:-

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

So is it the correct way to resolve the error or am I doing something wrong here?
@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 🙏🏼
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
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 :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
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 :heart:
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 https://github.com/asyncapi/parser-js/pull/449
What do you think, should we close it or should we wait for https://github.com/asyncapi/parser-js/pull/449 PR?
cc @derberg @ritik307
up to @ritik307 if he can continue. Otherwise close I guess
Ok @ritik307 I will wait max 2 weeks for your response and in the case without response I will close this one.
I am closing due to lack of response.