# tags-unique

Source: https://apigenie.pl/docs/linter/openapi/rules/tags-unique

A rule of the OpenAPI linter, which reads OpenAPI 3.0, 3.1 and 3.2 documents. Since 0.0.1. Fixed by `--fix`. In the rulesets: Recommended at warning, Strict at error, All at error.

This rule checks that no two tags have the same name, compared without regard to case.

## Rule details

Operations refer to tags by name, so two tags named `user` and `User` are one group to the reader
and two to the tools, with two descriptions, and the operations tagged `User` land in whichever
the tool picks. Two tags with the same name are a typo or a merge that kept both sides.

The rule reports `Tag name is not unique (...)` on the later tag.

## Examples

**Good**.

```yaml
tags:
  - name: User
  - name: Product
```

**Bad**. One tag, or a typo?

```yaml
tags:
  - name: user
    description: First tag
  - name: User
    description: Is this another tag, or a typo?
```

## Automatic fixes

`--fix` removes a duplicate whose name, description and external documentation are those of the
first tag, and a duplicate that has a name only in favor of the one with a description. Duplicates
whose descriptions or external documentation differ stay for you to merge.
