Skip to main content

no-identical-paths

Finds paths that become identical after replacing every path parameter with a placeholder.

AttributeValue
CategoryOperations
MaturitySilver
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
Starter–LenientWarning
Recommended–CompleteError

Intent

Renaming a parameter does not create a new route. Two such templates compete for the same requests.

Flags

The later path when its only difference from an earlier path is one or more {parameterName} values. The complete path string is otherwise compared exactly.

Does not flag

Paths with different literal text or structure. Use no-ambiguous-paths for broader literal-versus-variable collisions.

See it fail

paths:
/customers/{customerId}:
get:
responses:
'200': {description: OK}
/customers/{id}:
delete:
responses:
'204': {description: Deleted}

The parameter name changes, but both templates match the same URLs.

Fix it

Combine methods under one path template:

paths:
/customers/{customerId}:
get:
responses:
'200': {description: OK}
delete:
responses:
'204': {description: Deleted}

Configure

profiles:
default:
rules:
extends: [recommended]
override:
no-identical-paths: warn

Nearby: no-ambiguous-paths, path-parameters-defined.