spectral:asyncapi warn on by default

asyncapi-tags

AsyncAPI object must have non-empty "tags" array.

Applies to
tags
Selects
$
Function
truthy
Specs
AsyncAPI 2.x

Use it

This rule ships with OpenLint in spectral:asyncapi. Extending the ruleset turns it on:

extends: spectral:asyncapi
rules:
  asyncapi-tags: warn   # or off, or another severity

Definition

As defined in @openlint/openlint-rulesets. Functions show by name.

asyncapi-tags:
  description: AsyncAPI object must have non-empty "tags" array.
  recommended: true
  formats:
    - AsyncAPI 2.x
  given: $
  then:
    field: tags
    function: truthy

About this rule

AsyncAPI root object should have non-empty tags array.

Why? Well, you can reference tags arbitrarily in operations, and definition is optional…

/invoices/{id}/items:
  tags:
    - Invoice Items

Defining tags allows you to add more information like a description. For more information see asyncapi-tag-description.

Sources