jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

OpenAPI → JSON Schema

Swagger 2.0 · OAS 3.0 / 3.1 · per-component extraction · draft 2020-12

Paste an OpenAPI 3.0 / 3.1 or Swagger 2.0 spec. Get each named component as a stand-alone JSON Schema (draft 2020-12 by default). Choose how $ref resolve: inline all, rewrite to $defs, or keep as-is.

Paste an OpenAPI spec.

How to extract schemas

  1. Paste your OpenAPI spec (JSON or YAML).
  2. The component list appears on the left — every named schema under components.schemas (OAS 3) or definitions (Swagger 2).
  3. Click any name to see the extracted JSON Schema with $refs resolved or rewritten — your choice via the Refs dropdown:
    • Inline all — fully expanded.
    • Rewrite to $defs — single self-contained schema with $defs.
    • Keep as-is$ref paths preserved (for assembling into larger specs).
  4. Download all dumps every component as a .zip of .json files.

FAQ

What about OAS 3.0 vs 3.1?

OAS 3.1 is fully JSON-Schema-compatible. 3.0 isn't — nullable: true becomes a union with null; xml and discriminator are dropped.

Does it preserve operations and paths?

No — this tool extracts component schemas only. For operation-level schemas (request / response bodies), pre-flatten into components or use a dedicated OpenAPI tool.

Will it work offline?

Yes — pure JavaScript.