chowbea-axios
Commands

validate

Check OpenAPI spec for issues that could affect generation.

The validate command analyzes your OpenAPI specification and reports issues that could cause problems during type generation.

Usage

chowbea-axios validate [flags]

What It Checks

Validation is grouped into seven categories. Each issue carries a severity (error, warning, or info) and a JSON Pointer to where it was found.

CategoryWhat it covers
structureTop-level required fields — openapi/swagger version, info, paths.
operationsEvery operation has an operationId and at least one response.
referencesEvery $ref resolves; no circular chains beyond the configured depth.
parametersPath parameters declared in URLs are also declared in the operation. Query/header params are well-formed.
responsesResponse definitions are present and reference resolvable schemas.
type-qualityHeuristics that affect generation quality — missing types, untyped any, additionalProperties: true patterns.
schemasComponent schemas are well-formed and referenced.

Flags

FlagShortDescriptionDefault
--config-cPath to api.config.tomlAuto-detected
--spec-sPath to OpenAPI spec fileFrom cache
--strict-Treat warnings as errorsfalse
--quiet-qSuppress non-error outputfalse
--verbose-vShow detailed outputfalse

Examples

Validate Cached Spec

chowbea-axios validate

Validate Specific File

chowbea-axios validate --spec ./openapi.json

Strict Mode

# Fail on warnings too
chowbea-axios validate --strict

Output

No Issues

╭────────────────────────────────────────
│ chowbea-axios validate
├────────────────────────────────────────

│ ✓ Validating OpenAPI spec... (specPath=app/services/api/_internal/openapi.json)

╰────────────────────────────────────────

│ ✓ Validation complete (errors=0, warnings=0)
│ ✓ OpenAPI spec is valid

With Warnings

╭────────────────────────────────────────
│ chowbea-axios validate
├────────────────────────────────────────

│ ✓ Validating OpenAPI spec...

├────────────────────────────────────────
│ Warnings
├────────────────────────────────────────

│ ⚠ Missing operationId - operation will be skipped during generation (path=/paths/users/get)
│ ⚠ Missing operationId - operation will be skipped during generation (path=/paths/users/post)

╰────────────────────────────────────────

│ ✓ Validation complete (errors=0, warnings=2)
│ ✓ OpenAPI spec is valid

With Errors

╭────────────────────────────────────────
│ Errors
├────────────────────────────────────────

│ ✗ Missing 'openapi' or 'swagger' version field (path=/)
│ ✗ Missing required 'info' object (path=/info)

╰────────────────────────────────────────

│ ✓ Validation complete (errors=2, warnings=0)

Severity Levels

SeverityWhenBehavior
errorThe spec is malformed enough that generation will fail or silently drop endpointsNon-zero exit; always reported.
warningGeneration will succeed but quality will suffer (missing operationId, untyped responses)Reported; exits non-zero only under --strict.
infoStylistic or low-impact notesReported; never fails.

Each category shows a passed / failed / total checks count so you can see at a glance which areas are clean and which need work.

Why operationId Matters

Operations without operationId will:

  • Not generate operation-based methods (api.op.xxx)
  • Still work with path-based API (api.get("/path"))

Example spec without operationId:

paths:
  /users:
    get:
      # No operationId - will be skipped for operations
      summary: List users

With operationId:

paths:
  /users:
    get:
      operationId: listUsers  # Will generate api.op.listUsers()
      summary: List users

Use Cases

Before Deployment

# Ensure spec is valid before CI/CD
chowbea-axios validate --strict

Debugging Missing Operations

# See which endpoints lack operationId
chowbea-axios validate

Validating External Specs

# Check a spec before using it
chowbea-axios validate --spec ./external-api.json

Exit Codes

CodeMeaning
0Valid (no errors, warnings allowed)
1Errors found, or warnings found with --strict

Next Steps

On this page