Last updated

operation-operationId-unique

Requires unique operationId values for each operation.

OASCompatibility
2.0
3.0
3.1

API design principle

The operationId is used by tooling to identify operations (which are otherwise done through scary looking JSON pointers).

The operationId should be unique (used only once in an OpenAPI description).

This rule is unopinionated.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default error (in recommended configuration).

An example configuration:

rules:
  operation-operationId-unique: error

Examples

Given this configuration:

rules:
  operation-operationId-unique: error

Example of incorrect operations:

paths:
  /cars:
    get:
      operationId: Car
      # ...
    post:
      operationId: Car
      # ...

Example of correct operations:

paths:
  /cars:
    get:
      operationId: getCar
      # ...
    post:
      operationId: postCar
      # ...

Resources