Skip to content

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

Closed

Description

@derberg

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

Activity

  1. added
    enhancement
    on Aug 10, 2020
  2. github-actions commented on Dec 1, 2020

    @github-actions

    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 ❤️

  3. github-actions commented on Jan 31, 2021

    @github-actions

    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 ❤️

  4. added
    good first issue
    and removed on Apr 1, 2021
  5. reopened this on Apr 1, 2021
  6. github-actions commented on Jun 1, 2021

    @github-actions

    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 ❤️

  7. github-actions commented on Aug 1, 2021

    @github-actions

    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 ❤️

  8. 6 remaining items

  9. derberg commented on Jan 17, 2022

    @derberg
    MemberAuthor

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

  10. ritik307 commented on Jan 17, 2022

    @ritik307

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

  11. ritik307 commented on Jan 18, 2022

    @ritik307

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

  12. derberg commented on Jan 18, 2022

    @derberg
    MemberAuthor

    @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 🙏🏼

  13. github-actions commented on May 19, 2022

    @github-actions

    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 ❤️

  14. github-actions commented on Sep 17, 2022

    @github-actions

    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 ❤️

  15. magicmatatjahu commented on Oct 25, 2022

    @magicmatatjahu
    Member
  16. derberg commented on Oct 25, 2022

    @derberg
    MemberAuthor

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

  17. magicmatatjahu commented on Oct 28, 2022

    @magicmatatjahu
    Member

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

  18. magicmatatjahu commented on Nov 15, 2022

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions