JSON to OpenAPI Schema Generator
Paste a sample JSON value and generate an OpenAPI 3.0 schema object -- types, required,
nested properties, nullable -- ready to paste into
components.schemas.<Name>.
About This Tool
Writing an OpenAPI components.schemas entry by hand from an example API response is the same
mechanical walk as writing a plain JSON Schema, with a few dialect differences: no $schema
or $id meta keys, and nullable fields use nullable: true next to a base type
instead of a type array. This tool runs the same shape inference as
JSON Schema Generator and reshapes the result into that dialect, output
as YAML (matching how most OpenAPI specs are authored) or JSON.
If you want plain, standalone Draft-07 JSON Schema instead -- for a $ref-based validator, not
an OpenAPI spec -- use JSON Schema Generator. To go the other
direction, from a full Postman collection to an OpenAPI spec, see Postman
to OpenAPI.
Key Features
- OpenAPI 3.0 dialect: no
$schema/$id,nullable: trueinstead of a null type. - YAML or JSON output: toggle without re-running inference.
- Recursive type inference: built on the same engine as JSON Schema Generator: objects, arrays, and primitives at every depth.
- Optional schema name: sets a
title, matching the key you'd give it undercomponents.schemas. - File upload & drag-and-drop: load a
.jsonfile directly instead of pasting. - Keyboard-driven: Cmd/Ctrl+Enter to generate, Cmd/Ctrl+Shift+C to copy the output.
Example
Sample input:
{"id": 1, "name": "Ada", "nickname": null} generates (YAML):
type: object
required:
- id
- name
- nickname
properties:
id:
type: integer
name:
type: string
nickname:
nullable: true