A simple JSON Schema to Markdown generator.
This generator doesn't attempt to support the full JSON Schema specification. Instead, it's designed with the rationale that most people are only using a subset of the spec.
Install
go install github.com/marcusolsson/json-schema-docs
Run
json-schema-docs -schema ./user.schema.json > user.mdTo use a template when generating the Markdown:
json-schema-docs -schema ./user.schema.json -template user.md.tpl > user.mdtemplate is the path to a file containing a Go template, such as this one:
+++ title = "{{ .Title }}" description = "{{ .Description }}" +++ # API reference This is the reference documentation for an API. {{ .Markdown 2 }}
The argument to .Markdown is the heading level you want the docs to start at.