JSON-Utils

JSON to OpenAPI Schema

Generate an OpenAPI document from a JSON sample of a request or response body. The inferred schema lands under components, nested objects become named schemas linked with $ref, and string formats like email are detected from the sample values. Choose OpenAPI 3.1, which aligns with JSON Schema 2020-12, or 3.0, which most tooling still consumes, and YAML or JSON output.

JSON
OpenAPI
Result will appear here
Ready. Press Generate or Ctrl+Enter.

How to use the JSON to OpenAPI Schema

  1. Paste a JSON sample of a request or response body.
  2. Choose OpenAPI 3.1 (JSON Schema aligned) or 3.0 (widest tooling support), and YAML or JSON output.
  3. Press Generate, then copy the document or download it.

Example

The author object becomes a named component schema, referenced with $ref.

{
  "name": "json-utils",
  "version": "1.0.0",
  "private": false,
  "tags": ["json", "tools"],
  "author": { "name": "Ada", "active": true },
  "score": 9.5,
  "notes": null
}

Frequently asked questions

3.1 or 3.0?

3.1 is the current version and aligns with JSON Schema 2020-12, including real null types. 3.0 is older but has the widest tooling support; null types become nullable markers there instead.

Where do paths come from?

They do not. A sample describes a body, not endpoints, so the document ships with empty paths for you to fill in around the generated schemas.