spectral:oas warn off by default

openapi-tags-alphabetical

OpenAPI object must have alphabetical "tags".

Applies to
tags
Selects
$
Function
alphabetical
Specs
OpenAPI 2.0OpenAPI 3.0OpenAPI 3.1OpenAPI 3.2

Use it

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

extends: spectral:oas
rules:
  openapi-tags-alphabetical: true

Definition

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

openapi-tags-alphabetical:
  description: OpenAPI object must have alphabetical "tags".
  recommended: false
  given: $
  then:
    field: tags
    function: alphabetical
    functionOptions:
      keyedBy: name

About this rule

OpenAPI 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