Skip to content

openapi/spectral

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

Part of the openapi configuration, at the recommended level. It runs at the commit stage, once per scope. It runs spectral. It skips until you set openapi.document.

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

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

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 for some files, or one of its lint rules, with a reason:

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