asyncapi / asyncapi/parser-js

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

Open
#878 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
144
Forks
144
Avg merge
6m
Merged PRs (30d)
11

Description

#### 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`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the parser call with the AsyncAPI YAML shown, including the invalid top-level test field, and inspect how the result is handled. Trace the parser's validation path to determine why it returns undefined; done means the invalid document consistently produces an error instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.