# paths-unique

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

A rule of the OpenAPI linter, which reads OpenAPI 3.0, 3.1 and 3.2 documents. Since 0.0.1. In the rulesets: Strict at error, All at error.

This rule checks that no two paths match the same requests. Paths that differ only in the names of
their placeholders, `/users/{id}` and `/users/{userId}`, are the same path.

## Rule details

Two path items for one path are two sets of operations for the same requests: a router takes one
of them, a documentation tool shows both, and a reader cannot tell which one the server runs.

The rule reports `Duplicate path found` on the later path item.

## Examples

**Good**. Two paths.

```yaml
paths:
  /users/{userId}:
    get:
      summary: Get a user by ID
  /users/{userId}/posts:
    get:
      summary: Get a user's posts
```

**Bad**. The same path with two placeholder names.

```yaml
paths:
  /users/{userId}:
    get:
      summary: Get a user by ID
  /users/{id}:
    get:
      summary: Get a user by ID
```
