Commands
kubb validate
The validate command checks a specification with the adapter in your Kubb config, or the OpenAPI adapter without one, and runs no generation.
kubb validate checks your spec with the adapter in your Kubb config and generates nothing. Run it in CI or before you commit a spec change.
On failure, it prints the validation error. When @kubb/adapter-oas is needed but missing, it prints the install command.
Arguments
| Argument | Required | What it does |
|---|---|---|
<input> | Yes | Path, URL, or git input of the spec, such as https://petstore3.swagger.io/api/v3/openapi.json. See input for the format. |
Options
| Flag | Alias | Default | What it does |
|---|---|---|---|
--config <path> | -c | Path to the Kubb config. Without it, Kubb looks for one the way kubb generate does. |
Terminal
kubb validate ./schema.graphql --config ./kubb.config.tsWhich adapter runs
| Situation | Adapter |
|---|---|
| A config is found or passed | The adapter of each config entry. |
| No config | @kubb/adapter-oas, for OpenAPI and Swagger documents. |
See Config loading.
Exit codes
| Code | When |
|---|---|
0 | The spec is valid. |
1 | The spec is invalid, a config entry has no adapter, or the adapter is not installed. |
