spectral:oas warn off by default

operation-singular-tag

Operation must not have more than a single tag.

Applies to
tags
Selects
#OperationObject
Function
length
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:
  operation-singular-tag: true

Definition

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

operation-singular-tag:
  description: Operation must not have more than a single tag.
  recommended: false
  given: '#OperationObject'
  then:
    field: tags
    function: length
    functionOptions:
      max: 1

About this rule

Use just one tag for an operation, which is helpful for some documentation systems which use tags to avoid duplicate content.

Sources