Linter rulesOpenAPIpaths-well-formed
paths-well-formed
Since 0.0.1 · fixed by --fix
This rule checks whether URLs of path items are well-formed.
Rule Details
Well-formed URLs enhance the readability and maintainability of the API’s structure.
The paths-well-formed rule is designed to ensure that all URLs of path items
are well-formed. This includes:
- starting with a forward slash
- not ending with a forward slash
- not having multiple consecutive slashes (e.g.,
//) - not having empty parameter placeholders (e.g.,
/{}/parts)
Configuration
None.
Examples
Good.
paths:
/users/{userId}:
get:
summary: Get a user by ID
Bad.
paths:
//users/{}/:
get:
summary: Get a user by ID
When Not to Use It
We recommend to always enable this rule.
Compatibility
This rule is compatible with all OpenAPI 3.x versions.