JSON Schema To OpenAPI Schema
Transform JSON Schema Draft 04 documents into OpenAPI 3.0 schema objects with nullable types, pattern properties, and dependency mapping.
Convert JSON Schema to OpenAPI 3.0 Schema Objects
OpenAPI 3.0 and JSON Schema are closely related but not identical. Keywords like
$schema, patternProperties, and nullable type arrays
(type: ["string", "null"]) are valid in JSON Schema but need adjustment for OpenAPI
3.0 Schema Objects. This tool automates that conversion so you can reuse JSON Schema as the single
source of truth for API contracts.
What this tool does
Paste a JSON Schema Draft 04 document in the input panel. The converter maps it to an OpenAPI 3.0
Schema Object: nullable unions become nullable: true, unsupported keywords are renamed or
transformed, and nested structures including allOf are preserved. Output updates
automatically as you edit.
Why convert JSON Schema for OpenAPI 3.0?
OpenAPI 3.1 aligns closely with modern JSON Schema, but many teams still publish OpenAPI 3.0 specs. Hand-editing every schema difference is slow and error-prone. Automated conversion keeps validation rules in JSON Schema while producing Swagger-compatible schema objects for documentation generators and SDK tooling.
Common use cases
- Embed JSON Schema validation rules into an existing OpenAPI 3.0 specification.
- Migrate backend validation schemas into API documentation without duplicating definitions.
- Normalize nullable type arrays and pattern properties for Swagger UI and codegen tools.
- Preview how a JSON Schema will look inside an OpenAPI components section.
Related tools
Generate JSON Schema from sample JSON with the JSON to JSON Schema Generator, validate payloads with the JSON Validator, or format output with the JSON Formatter.
Frequently Asked Questions
Which JSON Schema version is supported?
This converter targets JSON Schema Draft 04, which is the dialect most closely aligned with OpenAPI 3.0 Schema Objects. Draft 07 schemas with similar constructs often convert correctly, but Draft 04 is the expected input format.
How are nullable types handled?
A type array such as ["string", "null"] is converted to
type: "string" with nullable: true, which is the OpenAPI 3.0
convention for optional null values.
What happens to patternProperties?
OpenAPI 3.0 does not support patternProperties directly. The converter renames
them to x-patternProperties so the intent is preserved as an extension field.
Can I convert schemas with external $ref URLs?
This browser tool uses synchronous conversion and does not fetch external references. Inline
schemas and local $ref fragments within the pasted document are supported.
External HTTP or file references require dereferencing before conversion.
Is my schema sent to a server?
No. Conversion runs entirely in your browser. Your JSON Schema documents never leave your device.