---
title: "Spectral API linting"
description: "Lints OpenAPI, Swagger and AsyncAPI documents with Spectral's built-in oas and asyncapi rulesets. Project .spectral.* rulesets are ignored because they can run custom JavaScript. Documents with remote or out-of-project $refs are not linted, since Spectral would fetch them."
url: https://openaudit.se/auditors/code.spectral/
---

# Spectral API linting

`code.spectral`

Lints OpenAPI, Swagger and AsyncAPI documents with Spectral's built-in oas and asyncapi rulesets. Project .spectral.* rulesets are ignored because they can run custom JavaScript. Documents with remote or out-of-project $refs are not linted, since Spectral would fetch them.

- **Engine:** Wrapped scanner
- **Wraps:** `spectral`
- **Targets:** Codebase
- **Areas:** Best practices, Reliability
- **Runs:** By default, when the target applies
- **Network:** Only the target itself

## Run only this auditor

```sh
bunx @openaudit/cli . --only code.spectral
```

Wraps spectral. When it isn't installed, the auditor is skipped with an install hint and the rest of the audit runs.

## More best practices auditors

- [Repository hygiene](https://openaudit.se/auditors/code.hygiene/) (`code.hygiene`)
