OpenAPI Validator & Converter API

Validate OpenAPI 3.0, 3.1, 3.2 and Swagger 2.0 against the official schemas, lint common mistakes, list endpoints, YAML ↔ JSON, upgrade Swagger 2 to OAS 3.

GETPOSThttps://apibox.io.vn/v1/openapi-tools
Developer utilities▶ Try it online

Send an API definition as spec (YAML or JSON text, or a JSON object), as a text body, or give its url. With action=validate (default) the document is checked against the official JSON Schema of its version published by the OpenAPI Initiative (Swagger 2.0, OpenAPI 3.0, 3.1 and 3.2, refreshed weekly) and errors are reduced to the useful ones: for oneOf alternatives only the variant you most likely meant is reported, with the JSON pointer of each problem.

A built-in linter adds what the schema cannot see: $ref that do not resolve, duplicate operationId, path parameters missing from parameters or not in the template, path parameters without required: true, equivalent paths (/a/{id} vs /a/{name}), undefined security schemes, operations without a 2xx response, GET with a request body, server URLs ending with a slash, unused components, and missing descriptions, tags, contact or licence (as info). stats counts paths, operations by method, schemas and servers.

action=endpoints lists every operation (method, path, operationId, summary, tags, parameters, request body content types, response codes, security); action=convert turns YAML into JSON and back (to); action=upgrade converts Swagger 2.0 into OpenAPI 3.0.3 (servers from host / basePath / schemes, requestBody from body and formData parameters, components, security flows, $ref rewriting, x-nullable) and validates the result. External $ref files are not fetched. Up to 10 MB.

Parameters

NameInTypeRequiredDefault
specbodystringnoThe OpenAPI / Swagger document: YAML or JSON text, or a JSON object. Or a raw text body.
urlbody|querystringnoPublic URL of the document, instead of spec.
actionbody|querystringnovalidatevalidate (schema + lint + stats), endpoints, convert (YAML ↔ JSON) or upgrade (Swagger 2.0 → OpenAPI 3.0.3).
tobody|querystringnojson or yaml for convert / upgrade (default: the other format for convert, the same for upgrade).
lintbody|querybooleannotruefalse skips the lint rules.

Example

curl -X POST "https://apibox.io.vn/v1/openapi-tools" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spec":"openapi: 3.0.3\ninfo:\n  title: Shop API\n  version: 1.0.0\npaths:\n  /orders/{id}:\n    get:\n      summary: Get an order\n      responses:\n        '\''200'\'':\n          description: The order\n"}'

Response

{
  "openapi_version": "3.0.3",
  "format": "yaml",
  "title": "Shop API",
  "api_version": "1.0.0",
  "valid": false,
  "schema_valid": true,
  "errors": [],
  "lint": {
    "errors": 1,
    "warnings": 2,
    "infos": 4,
    "issues": [
      {
        "rule": "servers-defined",
        "severity": "warning",
        "path": "/servers",
        "message": "No servers: clients will use the document location as base URL"
      },
      {
        "rule": "operation-operationId",
        "severity": "warning",
        "path": "/paths/~1orders~1{id}/get",
        "message": "GET /orders/{id} has no operationId"
      },
      {
        "rule": "path-params-defined",
        "severity": "error",
        "path": "/paths/~1orders~1{id}/get",
        "message": "Path parameter {id} of GET /orders/{id} is not defined in parameters"
      },
      "…"
    ]
  },
  "stats": {
    "paths": 1,
    "operations": 1,
    "by_method": {
      "GET": 1
    },
    "tags": [],
    "schemas": 0,
    "security_schemes": [],
    "servers": [],
    "deprecated_operations": 0
  },
  "schema_used": "https://spec.openapis.org/oas/3.0/schema/2024-10-18"
}

Use cases

  • Check an OpenAPI file in CI before publishing documentation or generating SDKs
  • Find broken $ref and duplicate operationId in a large specification
  • Migrate a Swagger 2.0 definition to OpenAPI 3
  • List all endpoints of a third-party API from its openapi.json URL

FAQ

Which versions are supported?

Swagger 2.0 and OpenAPI 3.0.x, 3.1.x and 3.2.x, each with its official JSON Schema from spec.openapis.org.

Are Schema Objects validated in 3.1?

The 3.1 / 3.2 schemas check the document structure; schemas inside it are checked for structure by the lint rules and $ref resolution, not against the full JSON Schema meta-schema.

Does it follow external $ref?

No. References to other files or URLs are listed as info and not fetched; local references (#/...) are all resolved and checked.

Related APIs

Start with 1,000 free requests every month. Get free API key →