Skip to main content

operation-singular-tag

Allows at most one tag on each operation.

AttributeValue
CategoryOperations
MaturityGold
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
Starter–RecommendedOff
StrictWarning
CompleteError

Intent

One tag gives each operation a single, predictable home in generated documentation and client groupings.

Flags

An operation whose tags array contains more than one entry.

Does not flag

Missing, empty, or one-item tag arrays. Use operation-tag-defined to require a tag.

See it fail

get:
tags: [Payments, Reporting]
responses:
'200': {description: OK}

Diagnostic: Operation `tags` object should have only one tag.

Fix it

Choose the operation's primary group:

get:
tags: [Payments]
responses:
'200': {description: OK}

Configure

profiles:
default:
rules:
extends: [strict]
override:
operation-singular-tag: error

Nearby: operation-tag-defined, tag-description.