Skip to content
Last updated

diff

Introduction

The diff section sets the impact of each diff rule. The diff command uses these impacts.

Use the diff section only at the root of a configuration file. API-specific sections do not support it.

Experimental

The diff section is an experimental feature. It can change in future releases.

Options

OptionTypeDescription
{rule name}stringREQUIRED. The impact of the changes that the rule reports. Possible values: major, minor, patch, off.

To set an impact for one specification version, use one of these sections. They have the same options.

  • oas3_0Diff
  • oas3_1Diff
  • oas3_2Diff
  • async3Diff

Examples

This example adds the diff-recommended ruleset, sets a lower impact for one rule, and turns off another rule:

extends:
  - diff-recommended
diff:
  enum-values-added: minor
  schema-constraint-changed: off

This example changes the impact of a rule for OpenAPI 3.1 descriptions only:

extends:
  - diff-recommended
oas3_1Diff:
  schema-type-changed: minor
  • extends adds the diff-recommended ruleset.

Resources

  • Diff rules - Changes that each rule reports and the impact of the diff-recommended ruleset
  • diff command - Compare two API descriptions and report the impact of each change
  • apis configuration - Define the API aliases that the diff command can compare