DevTools Logo

OpenAPI to Markdown Docs

OpenAPI to Markdown Docs

Turn a Swagger/OpenAPI spec into GitHub-flavored Markdown for wikis and pull requests.

Runs in your browser
Try an example

OpenAPI spec

Generated Markdown

Awaiting spec

Paste a spec to generate Markdown

The TOC, endpoint tables and schema appendix are built locally.

Details

Paste a YAML or JSON spec and get a single Markdown document you can commit next to your code: a GitHub-compatible table of contents, one section per endpoint with parameter, request-body and response tables, fenced JSON examples, a security-scheme section and a schema appendix with stable anchors. Internal $refs are resolved at render time with a cycle guard, so recursive schemas terminate with links instead of infinite tables. Options cover tag grouping, deprecated operations, flatten depth, schema descriptions and optional front matter. Swagger 2.0 body parameters, definitions and host/basePath are mapped automatically. Everything runs in your browser tab; the spec is never uploaded.

More examples

Wiki reference

petstore.yaml → api.md with TOC, GET /pets, GET /pets/{petId}, schema appendix

Download one file for a repo wiki; no hosted Redoc/Swagger UI required.

Recursive schema

Node.children → Node → anchor link, rendered once in the appendix

A visited-ref guard stops expansion while keeping links usable.

Legacy spec

swagger: 2.0 + in: body parameter + definitions → request body table and schema appendix

Swagger 2.0 bodies and definitions are mapped to the Markdown renderer.

Examples

Pet Store

Input
12 endpoints, nested Pet → Address refs
Output
api.md with TOC, endpoint tables and two schema sections

Referenced properties flatten into dotted rows such as address.city.

Recursive Node

Input
Node.children → Node
Output
One appendix section; the recursive property becomes a type link

The renderer tracks visited refs so output stays finite.

Swagger 2.0

Input
in: body parameter + definitions
Output
Request body table and legacy schema appendix

Legacy constructs are mapped rather than silently skipped.

About this tool

OpenAPI to Markdown Docs converts a pasted Swagger 2.0 or OpenAPI 3.x spec into a single, reviewable Markdown file. The output has a GitHub-compatible table of contents, a section per operation with parameter, request-body and response tables, and a schema appendix with stable anchors.

Internal $refs are resolved at render time rather than by mutating the spec. A visited-reference guard means recursive models — a Node whose children are Nodes — are expanded once and thereafter linked, so the generator always terminates. Schema tables flatten nested objects to dotted paths up to the depth you choose, with enums, formats and constraints in a dedicated column.

Examples from media types, schema-level examples or synthesized minimal payloads are emitted as fenced JSON; the fence grows to four backticks when the content itself contains a triple-backtick run. Swagger 2.0 body parameters, definitions, host and basePath are mapped to their modern equivalents, and security scheme definitions get their own section.

The preview is a simple, escape-by-construction renderer: spec-derived text is never injected as raw HTML. The raw Markdown tab is the artifact — copy it or download api.md for a wiki, PR or docs site. Nothing is uploaded.

What this tool does not do

  • Only internal $refs are resolved; external reference files are not fetched.
  • The preview is a structural subset of GitHub-flavored Markdown; always check the raw output for final rendering.
  • The YAML parser supports mappings, sequences, quoted/plain scalars and flow collections, not arbitrary YAML anchors.
  • Deeply nested anonymous objects beyond the chosen flatten depth are represented at their last expanded row.

How to use this tool

  1. Paste or load a spec

    Paste YAML/JSON into the input panel or load the Pet Store, recursive or Swagger 2.0 example.

  2. Tune the document

    Choose tag grouping, deprecated-operation handling, flatten depth, schema descriptions and optional front matter for Jekyll/Docusaurus.

  3. Inspect preview or raw Markdown

    Preview shows structure and tables; the Raw markdown tab contains the exact file that will be copied or downloaded.

  4. Export api.md

    Use Copy Markdown or Download .md, then commit the file alongside your API code.

Use cases

Repository wikis

Commit a Markdown reference that renders without hosting Swagger UI.

Pull requests

Attach endpoint documentation directly to the PR that changes the API.

Legacy conversion

Turn old Swagger documents into readable Markdown for migration reviews.

Static sites

Add front matter and drop api.md into Jekyll, Docusaurus or similar.

Generated document structure

SectionContents
HeaderTitle, version, description and base URL (2.0 host/basePath or 3.x servers)
TOCAnchored links grouped by tag or listed flat
EndpointMETHOD /path, summary, parameter/body/response tables, examples, security line
SchemasOne ### Schema: Name section with dotted property rows and anchor
Security schemesNamed schemes with type, scheme, in and name

Table cells escape pipes and line breaks; code fences adapt to their content.

Common mistakes

Mistake:Expecting an interactive API explorer.

Fix:This produces static Markdown; use a renderer for interactive docs.

Mistake:Pasting external multi-file $refs.

Fix:Only internal #/… references resolve here; external files are not fetched.

Mistake:Allowing deep recursion to blow up the document.

Fix:Use the flatten-depth selector; deeper objects are cut off at the chosen level.

Mistake:Piping a description containing | into a table.

Fix:The generator escapes pipes and converts newlines to <br> automatically.

Mistake:Assuming anchors from other Markdown flavors match.

Fix:Anchors target GitHub-flavored Markdown; other wikis may slug differently.

Frequently asked questions

Are $ref schemas expanded inline or linked?

Referenced schemas are expanded into dotted property rows up to the selected flatten depth; beyond that, and for recursive references, you get a link to the schema appendix (for example [Address](#schema-address)).

Is the TOC GitHub-compatible?

Yes. Anchors are lowercased, spaces become hyphens, underscores and Unicode letters are preserved, and duplicates get a -1 suffix. Other wikis may use different slug rules.

Does it include examples?

Yes. Media-type examples, schema examples and maps of examples are rendered as fenced JSON. If a spec has none, a minimal payload is synthesized from the schema and fenced as well.

Can it group endpoints by tag?

Yes, that is the default. Turn off Group endpoints by tag for a flat table of contents and a single ordered list of operations.

Does my spec leave the browser?

No. Parsing, rendering and download all happen locally; there is no network request, account or server-side conversion.

Does it support Swagger 2.0?

Yes. in: body parameters become request-body tables, definitions become the schema appendix, and host/basePath/schemes produce the base URL line.

References & standards