Ensures that tag names in the tags
array are unique. This rule prevents duplication of tag names which could lead to inconsistent API documentation.
OAS | Compatibility |
---|---|
2.0 | ✅ |
3.0 | ✅ |
3.1 | ✅ |
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.
Option | Type | Description |
---|---|---|
severity | string | Possible values: off , warn , error . Default warn (in recommended configuration). |
ignoreCase | boolean | Possible 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
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