Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageOperation id does not follow recommended naming conventions.
CodeOPENAPI3SYNTAX_L020
TypeLinting
Rule SystemSyntax
Broad CategoryOperations
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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