asyncapi/parser-js

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

Open

#876 建立於 2023年10月12日

在 GitHub 查看
 (11 留言) (0 反應) (0 負責人)TypeScript (135 fork)auto 404
area/typescriptbuggood first issue

倉庫指標

Star
 (144 star)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南