# `diff`

## Introduction

The `diff` section sets the impact of each [diff rule](/docs/cli/rules/diff-rules).
The [`diff` command](/docs/cli/v2/commands/diff) uses these impacts.

Use the `diff` section only at the root of a configuration file.
[API-specific sections](/docs/cli/v2/configuration/reference/apis) do not support it.

**Experimental**

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

## Options

| Option | Type | Description |
| --- | --- | --- |
| {rule name} | string | **REQUIRED**. 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:

```yaml
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:

```yaml
extends:
  - diff-recommended
oas3_1Diff:
  schema-type-changed: minor
```

## Related options

- [extends](/docs/cli/v2/configuration/reference/extends) adds the `diff-recommended` ruleset.

## Resources

- **[Diff rules](/docs/cli/rules/diff-rules)** - Changes that each rule reports and the impact of the `diff-recommended` ruleset
- **[`diff` command](/docs/cli/v2/commands/diff)** - Compare two API descriptions and report the impact of each change
- **[`apis` configuration](/docs/cli/v2/configuration/reference/apis)** - Define the API aliases that the `diff` command can compare
