Skip to content

[BUG] 2.17.0 & 3.1.1 asyncapi bundle & optimise breaks fifo channels #291

Description

@zbigniew-malcherczyk-tg

Describe the bug.

The AWS SNS topics and queues can be (first in first out) FIFO. To define such their name must end with .fifo (example user-created.fifo)

Content:

# asyncapi.yaml
asyncapi: 2.0.0
info:
  title: Service
  version: 1.0.0

channels:
  '{ENV}-user-created.fifo':
    publish:
      message:
        $ref: '#/components/messages/UserCreated'

components:
  messages:
    UserCreated:
      $ref: 'UserCreated.yaml'
# UserCreated.yaml
payload:
  type: object
  properties:
    eventName:
      type: string
      description: The name of the event.

Execute:

asyncapi bundle asyncapi.yaml -x -o output.yaml

Then Execute:

asyncapi optimize output.yaml --optimization=reuse-components -o=overwrite --no-tty

The result is invalid Async API document:

asyncapi: 2.0.0
info:
  title: Remittance
  version: 1.0.0
channels:
  '{ENV}-user-created.fifo':
    publish:
      message:
        payload:
          type: object
          properties:
            eventName:
              type: string
              description: The name of the event.
        x-origin: UserCreated.yaml
  '{ENV}-user-created':
    fifo:
      publish:
        message:
          $ref: '#/components/messages/UserCreated'
components:
  messages:
    UserCreated:
      payload:
        type: object
        properties:
          eventName:
            type: string
            description: The name of the event.
      x-origin: UserCreated.yaml

Expected behavior

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions