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.

Okay, so we're documentation folks here. You're thinking, "of course they would say that." You're right! And we're right! Do this, and your (future) teammates will thank you. Do this, and your API consumers will thank you.

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