# openapi/spectral

> Lints the file in `openapi.document` with the Spectral OpenAPI rules.

Lints the file in `openapi.document` with the Spectral OpenAPI rules.

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

## Why

Teams generate clients from this document, so an operation with no ID or an undefined response breaks them.

## What to do

Change the document the way the rule says, or the code that writes it.

## Example

An operation that references an undefined schema reports a finding. Define the schema or fix the reference in the source, then generate the document again.

## Turn it off

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

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