openapi-tags
OpenAPI object must have non-empty "tags" array.
- Applies to
tags- Selects
$- Function
schema- 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: true
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
openapi-tags:
description: OpenAPI object must have non-empty "tags" array.
recommended: false
given: $
then:
field: tags
function: schema
functionOptions:
dialect: draft7
schema:
type: array
minItems: 1
About this rule
OpenAPI object should have non-empty tags array.
Why? Well, you can reference tags arbitrarily in operations, and definition is optional…
/invoices/{id}/items:
get:
tags:
- Invoice Items
Defining tags allows you to add more information like a description. For more information see tag-description.