valid-operation-id-naming-conventions
Overview
This rule belongs to the openapi-v3-syntax-linting
ruleset and states that:
The id of an Operation Object specified using the operationId
property is a unique identifier of the operation in the complete API document. This id may be used by tools or libraries e.g. code generators. It is therefore recommended to follow common programming naming conventions e.g. snake case, kebab case, pascal case or camel case. Such conventions use mainly alphanumeric characters, hyphens and underscores. Spaces are not allowed.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Operation id does not follow recommended naming conventions. |
Code | OPENAPI3SYNTAX_L020 |
Type | Linting |
Rule System | Syntax |
Broad Category | Operations |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi syntax linting operation id id operation |
Suggested Fixes
- Make sure that the id does not contain any forbidden characters.
- The id must not contain any forbidden file name characters as the ids may be used in generation of files during code generation or other similar processes.
- Ensure that the id does not contain any spaces.
- Use only alphanumeric characters, hyphens or underscores.
- The id must be short and code-friendly.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/