mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 12:47:48 +00:00
1.6 KiB
1.6 KiB
operation-operationId-url-safe
Requires the operationId value to be URL safe.
| OAS | Compatibility |
|---|---|
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
API design principles
The operationId is used by tooling to identify operations (which are otherwise done through scary looking JSON pointers).
Some tooling may use it in a URL path.
This rule makes it possible to use the operationId in URLs without any transformation of the operationId.
This rule is unopinionated.
Configuration
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default error (in recommended configuration). |
An example configuration:
styleguide:
rules:
operation-operationId-url-safe: error
Examples
Given this configuration:
styleguide:
rules:
operation-operationId-url-safe: error
Example of an incorrect operation:
paths:
/cars:
get:
operationId: Car<>Wash
# ...
Example of a correct operation:
paths:
/cars:
get:
operationId: CarWash
# ...
Related rules
Resources
- Rule source
- Operation object docs
- Consider using assertions for more specific rules for
operationIds such as length, casing, and pattern enforcement.