Langsung ke konten
POST AI agent ready /v1/schema/openapi-validate

OpenAPI Validate API - Check 3.0 and 3.1 Spec Correctness

Checks required top-level fields (openapi, info with title and version, paths), verifies paths start with "/", validates each operation has a responses block, and warns about empty spec scaffolding. Accepts a spec as an object or as a stringified JSON.

Parameters

objectrequired

OpenAPI spec as an object or JSON string.

Code examples

curl -X POST https://api.botoi.com/v1/schema/openapi-validate \
  -H "Content-Type: application/json" \
  -d '{"spec":{"openapi":"3.1.0","info":{"title":"Demo"},"paths":{"/users":{"get":{}}}}}'

When to use this API

Gate pull requests on spec correctness

In CI, validate your openapi.json before deploy. Blocking a PR for a missing title or responses block is cheaper than shipping a broken docs page.

Validate generated specs

When a framework emits OpenAPI from code annotations, run the output through this endpoint. Catches cases where the spec technically serializes but violates the OpenAPI required-fields rules.

Onboard third-party API specs

Before importing a partner's OpenAPI file into your SDK generator, validate it. Fixes obvious problems upfront instead of debugging cryptic codegen errors later.

Frequently asked questions

Is this a full OpenAPI validator?
No. This is a lightweight structural check. It catches missing required fields and common errors but does not validate every spec constraint (parameter schemas, response object shapes, security scheme types). Use swagger-cli or openapi-validator locally for deep validation.
Does it support 2.0 (Swagger)?
No. Only OpenAPI 3.x is recognized. A 2.0 spec returns an error about unsupported version.
What counts as a warning vs. error?
Errors are spec violations that make the document invalid (missing required field, non-"/"-prefixed path). Warnings are suspicious but technically legal patterns (empty paths, operation without responses).
Can I pass the spec as YAML?
Not directly. Convert YAML to JSON first with /v1/yaml/to-json, then pass the result here.
What does version field in the response mean?
It echoes the value from the openapi top-level field (e.g., "3.1.0"). Useful for logging and for deciding which linter rules to apply downstream.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.