asyncapi / asyncapi/parser-js

Parser do not validate if channel that is referenced in reply with location has `null` in address

Open
#876 14 comments 0 reactions 0 assignees View on GitHub
area/typescript bug good first issue
Dominant language
TypeScript
Stars
144
Forks
144
Avg merge
6m
Merged PRs (30d)
11

Description

Like in the title

So I have such document
```yml
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
replyChannel:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
userSignedup:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
sendUserSignedup:
action: send
channel:
$ref: '#/channels/userSignedup'
messages:
- $ref: '#/channels/userSignedup/messages/UserSignedUp'
reply:
channel:
$ref: '#/channels/replyChannel'
address:
location: '$message.header#/REPLY_TOPIC'
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
```

it should not be a valid document. Spec explicitly defines that if in reply you specify dynamic location of the response address (`reply.address`) then referenced channel must have undefined address or `address: null`

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by running the parser against the YAML document in the report and inspect the validation result for the reply channel and dynamic reply.address.location. Trace the validation entry point that handles reply channel references. Done means this document is rejected because the referenced channel has a concrete address instead of an undefined or null address.

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
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.