Skip to content

How to describe a tuple in AsyncAPI? #1135

Answered by RobinTail
RobinTail asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out what was the issue with items approach — it does work, but for non-empty tuples only.
If items is an empty array, validator of Studio shows a huge pile of errors pointing to wrong lines.
But once I restricted items to describe only non-empty tuples, it began working as expected:

Here is my implementation for those might having similar issue:

        payload:
          type: array
          items:
            - type: string
              description: message
            - type: object
              properties:
                from:
                  type: string
                  description: the ID of author
              required:
                - from
              descr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RobinTail
Comment options

Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant