asyncapi/parser-js

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

Open

#876 aberto em 12 de out. de 2023

Ver no GitHub
 (11 comments) (0 reactions) (0 assignees)TypeScript (135 forks)auto 404
area/typescriptbuggood first issue

Métricas do repositório

Stars
 (144 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Like in the title

So I have such document

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

Guia do colaborador