This rule checks whether each tag defined in an OpenAPI schema has a meaningful description.
Tag descriptions provide necessary context about the purpose and usage of the tag, improving the readability and understanding of the API’s structure.
The tag-description-defined
rule checks all tags defined in an OpenAPI schema
and raises an issue if any of them have description missing or empty.
Besides missing and empty descriptions this rule disregards descriptions that:
The configuration block is a single positive integer, which specifies the minimal number of characters in a “meaningful” description. The default value is 10.
Configuration Example
lint:
rules:
tag-description-defined:
- warning
- 20
Good.
tags:
- name: User
description: Operations related to the User entity.
- name: Product
description: Operations related to the Product entity.
Bad.
tags:
- name: User
description: ''
- name: Product
We recommend to always enable this rule.
This rule is compatible with all OpenAPI 3.x versions.