# openapi/stale-document

> Runs `openapi.generate_command` and fails when the document changes.

Runs `openapi.generate_command` and fails when the document changes.

Part of the [`openapi`](/reference/configurations/openapi/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `push` [stage](/start/concepts/#stage), once per scope. It runs the command in `openapi.generate_command`. It skips until you set `openapi.generate_command`.

## Why

A committed document that lags the routes describes a service that does not exist.

## What to do

Run the command and commit the document it writes.

## Example

A committed document that differs from the generator output reports drift. Run the generator, review the change, and commit it.

## Turn it off

Turn it off for some files, or one of its lint rules, with a reason:

```shell
gspot ignore openapi/stale-document --paths "<glob>" --reason "<why>"
gspot ignore openapi/stale-document --rule <rule> --reason "<why>"
```
