Schema Table to Markdown Converter
Convert JSON Schema tables into clean, aligned Markdown tables. Supports JSON Schema draft-04/07, OpenAPI, nested objects, and custom formats.
About
API documentation drifts from reality when schema definitions are manually transcribed into Markdown. A single mistyped type field or a forgotten required constraint propagates confusion across every consumer of your API. This tool parses JSON Schema structures - including nested properties objects, allOf compositions, and OpenAPI-style component schemas - and produces pipe-aligned Markdown tables suitable for GitHub READMEs, Wikis, or static site generators. It handles dot-notation flattening for objects nested up to 10 levels deep. The output is deterministic: identical input always yields identical Markdown. Note: this tool assumes well-formed JSON. Malformed input (trailing commas, single-quoted keys) is rejected with a specific error location.
Formulas
The conversion follows a deterministic pipeline. First, the JSON input is parsed and classified by format. Then, a recursive extractor walks the schema tree producing flat rows.
Column width alignment uses the maximum character count per column across all rows including the header:
Nested property paths use dot-notation flattening:
Where input is the raw JSON string, tree is the parsed JavaScript object, schema is the classified schema structure, rows is the array of extracted table rows, wcol is the computed width for each column, and markdown is the final output string. Pipe characters (|) within cell values are escaped as \| to prevent table corruption.
Reference Data
| Schema Format | Detection Key | Extracted Columns | Nesting Support |
|---|---|---|---|
| JSON Schema draft-04 | properties + type: "object" | Property, Type, Description, Default, Required | Recursive dot-notation |
| JSON Schema draft-06/07 | $schema keyword | Property, Type, Description, Default, Required, Examples | Recursive dot-notation |
| OpenAPI 3.x Component | components.schemas | Property, Type, Format, Description, Required, Enum | $ref resolution (local) |
| Array of Descriptors | Root is Array | All unique keys become columns | Flat only |
| Simple Key-Value | Root is Object, no "properties" | Key, Value, Type (inferred) | One level |
| TypeScript-like Interface | properties with enum | Property, Type, Enum Values, Description | Recursive dot-notation |
| Mongoose Schema | Values contain type as constructor name | Field, Type, Required, Default, Ref | Nested subdocuments |
| Joi-like Descriptor | type + flags | Field, Type, Presence, Default, Rules | Keys children |
| Sequelize Model | Values with DataTypes or type object | Column, Type, AllowNull, Default, PrimaryKey | Flat |
| Custom Tabular JSON | Array of uniform objects | Dynamic from keys | Flat |
| GraphQL-like Type | fields array | Field, Type, Nullable, Description | Nested types |
| Protobuf-like | fields with id | ID, Field, Type, Rule, Description | Nested messages |