Skip to content
Last updated

Ensures that tag names in the tags array are unique. This rule prevents duplication of tag names which could lead to inconsistent API documentation.

OASCompatibility
2.0
3.0
3.1

API design principles

Tags are used to group operations in OpenAPI specifications. Create unique tags to clearly categorize operations. Having duplicate tags can cause confusion in documentation rendering tools, makes the specification harder to maintain, and may lead to operations being grouped incorrectly.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default warn (in recommended configuration).
ignoreCasebooleanPossible values: true, false. Default false (in recommended configuration). Set to true to treat tags with different casing as duplicates (e.g., "Pet" and "pet").

An example configuration:

rules:
  no-duplicated-tag-names: error

Configuration that ignores case:

rules:
  no-duplicated-tag-names:
    severity: error
    ignoreCase: true

Examples

Given this configuration:

rules:
  no-duplicated-tag-names: error

Example of incorrect tags:

tags:
  - name: pet
    description: Everything about your Pets
  - name: store
    description: Access to Petstore orders
  - name: store
    description: Duplicated store tag

Example of correct tags:

tags:
  - name: pet
    description: Everything about your Pets
  - name: store
    description: Access to Petstore orders
  - name: user
    description: Operations about user

With ignoreCase: true, this would also be incorrect:

tags:
  - name: pet
    description: Everything about your Pets
  - name: store
    description: Access to Petstore orders
  - name: Store
    description: Case-sensitive duplicate

Resources