path-segment-plural
Requires literal resource path segments to look plural.
| Attribute | Value |
|---|---|
| Category | Operations |
| Maturity | Gold |
| OpenAPI | Swagger 2.0; OpenAPI 3.0, 3.1, 3.2 |
| Starter–Recommended | Off |
| Strict | Warning |
| Complete | Error |
Intent
Plural resource names make collection-oriented paths consistent and easier to predict.
Flags
The path once, at its first literal segment that:
- has more than one character;
- contains a letter;
- does not end in lowercase
s; and - is not one of
men,women,children,people,teeth,feet,geese, ormicewhen compared case-insensitively.
Path-template variables are skipped.
Does not flag
Segments that pass the heuristic, configured exceptions, or—when configured—the final path segment. This is a lightweight naming heuristic, not a full English inflector.
See it fail
paths:
/customer/{customerId}:
get:
responses:
'200': {description: OK}
Diagnostic: path segment `customer` should be plural.
Fix it
paths:
/customers/{customerId}:
get:
responses:
'200': {description: OK}
Configure
profiles:
default:
rules:
extends: [strict]
override:
path-segment-plural:
severity: error
ignoreLastPathSegment: true
exceptions: [health, metadata]
Exceptions match complete segments exactly and case-sensitively.
Nearby: no-http-verbs-in-paths, paths-kebab-case.