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

Parser fails to throw an error when i provide an invalid asyncapi file

Open AceTheCreator opened this issue 1 year ago • 1 comments

Describe the bug

The Parser doesn't throw any error when I provide an invalid asyncapi file but instead returns undefined

How to Reproduce

Here as you can see Included the test:hello which makes the following asyncapi doc invalid

asyncapi: 3.0.0
test: hello
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  user/signedup:
    address: user/signedup
    messages:
      subscribe.message:
        $ref: '#/components/messages/UserSignedUp'
operations:
  user/signedup.subscribe:
    action: send
    channel:
      $ref: '#/channels/user~1signedup'
    messages:
      - $ref: '#/components/messages/UserSignedUp'
    reply:
      channel:
        $ref: '#/channels/user~1signedup'
      messages:
        - $ref: '#/components/messages/UserSignedUp'
components:
  messages:
    UserSignedUp:
      payload:
        type: object
        properties:
          displayName:
            type: string
            description: Name of the user
          email:
            type: string
            format: email
            description: Email of the user

Expected behavior

I expect the Parser to return an error not undefined

AceTheCreator avatar Oct 12 '23 17:10 AceTheCreator