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 description, or from other documentation and external resources that may not be accurate. Your API description 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:
rules: operation-description: error
Examples
Given this configuration:
rules: operation-description: error
Example of an incorrect operation:
get: responses: '200': $ref: ../components/responses/Success.yaml
Example of a correct operation:
get: description: Returns the latest updated user profile. responses: '200': $ref: ../components/responses/Success.yaml
Related rules
Resources
- Rule source
- Consider using configurable rules for more specific rules for operation descriptions such as minimum length and pattern enforcement.
- Operation object docs