Skip to content
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.

kubb validate ./petStore.yaml

On failure, it prints the validation error. When @kubb/adapter-oas is needed but missing, it prints the install command.

Arguments

ArgumentRequiredWhat it does
<input>YesPath, URL, or git input of the spec, such as https://petstore3.swagger.io/api/v3/openapi.json. See input for the format.

Options

FlagAliasDefaultWhat it does
--config <path>-cPath to the Kubb config. Without it, Kubb looks for one the way kubb generate does.
Terminal
kubb validate ./schema.graphql --config ./kubb.config.ts

Which adapter runs

SituationAdapter
A config is found or passedThe adapter of each config entry.
No config@kubb/adapter-oas, for OpenAPI and Swagger documents.

See Config loading.

Exit codes

CodeWhen
0The spec is valid.
1The spec is invalid, a config entry has no adapter, or the adapter is not installed.