operation-description

Requires the description field for every operation in your API.

OAS Compatibility
2.0
3.0
3.1

API design principles

Every operation should have a description to help your API consumers understand what it does and how to use it. Without a description, people who want to use your API have to guess what an operation does, or try to decipher it from other parts of your API definition, or from other documentation and external resources that may not be accurate. Your API definition should be the single source of truth about your API. Add the description field and delight both your (future) teammates and your API consumers.

Configuration

Option Type Description
severity string Possible values: off, warn, error. Default off (in recommended configuration).

An example configuration:

Copy
Copied
rules:
  operation-description: error

Examples

Given this configuration:

Copy
Copied
rules:
  operation-description: error

Example of an incorrect operation:

Copy
Copied
get:
  responses:
    '200':
      $ref: ../components/responses/Success.yaml

Example of a correct operation:

Copy
Copied
get:
  description: Returns the latest updated user profile.
  responses:
    '200':
      $ref: ../components/responses/Success.yaml

Related rules

Resources