spectral:asyncapi warn off by default

asyncapi-tags-alphabetical

AsyncAPI object must have alphabetical "tags".

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

Use it

This rule ships with OpenLint in spectral:asyncapi. It's off by default, so turn it on by name:

extends: spectral:asyncapi
rules:
  asyncapi-tags-alphabetical: true

Definition

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

asyncapi-tags-alphabetical:
  description: AsyncAPI object must have alphabetical "tags".
  recommended: false
  formats:
    - AsyncAPI 2.x
  given: $
  then:
    field: tags
    function: alphabetical
    functionOptions:
      keyedBy: name

About this rule

AsyncAPI object should have alphabetical tags. This will be sorted by the name property.

Bad Example

tags:
  - name: "Badger"
  - name: "Aardvark"

Good Example

tags:
  - name: "Aardvark"
  - name: "Badger"

Sources