mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
2.0 KiB
2.0 KiB
slug
| slug |
|---|
| /docs/cli/rules/paths-kebab-case |
paths-kebab-case
Require kebab-case in paths instead of camelCase or snake_case.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
API design principles
The base URL is case insensitive. The paths are case sensitive. It's a good practice to NOT confuse anyone, including yourself, with that fact, by using lowercase paths.
However, whatsapersontodowhenapathbecomesreallyhardtoread? Use the de facto standard of kebab-case.
Let's see if that question from above is easier to read this time around: whats-a-person-to-do-when-a-path-becomes-really-hard-to-read? Much better.
Don't adhere to this rule at your own risk. We don't want to say we told ya so!
Configuration
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default off (in recommended configuration). |
An example configuration:
rules:
paths-kebab-case: error
Examples
Given this configuration:
rules:
paths-kebab-case: error
Example of an incorrect path:
paths:
/customer_orders/{id}:
post:
parameters:
- name: id
in: path
required: true
Example of a correct path:
paths:
/customer-orders/{id}:
post:
parameters:
- name: id
in: path
required: true
description: The customer's ID.