json-schema-gendoc
v0.0.8
Published
JSON Schema documentation generator
Maintainers
Readme
JSON Schema documentation generator
Basic tool used to generate human-readable Markdown documentation from a JSON Schema Validation file. Can be used as a standalone CLI-tool, or imported into an existing JavaScript-project.
Currently, only a small part of the standard is supported.
Preview
Configuration.md is generated from config.schema.json in this repository.
Installation
npm install -g json-schema-gendocUsage
Use the following command to genearate a Markdown document from a JSON Schema Validation file.
json-schema-gendoc /path/to/json-schema-file.jsonConfiguration
json-schema-gendoc can be configured using by creating a file named .json-schema-gendoc.json in the current working directory. The
default configuration is included below. All properties are optional. Use translations to translate standard messages into your
preferred language if it does not exist in the translations folder (or, even better, create a translation file and send me a PR),
and schemaFile to define which file you'd like to generate documentation from.
See Configuration.md for details.
{
"schemaFile": null,
"title": null,
"outputFormat": "markdown",
"language": "en",
"translations": {
"examples": "Examples",
"properties": "Properties",
"enum": "Possible values",
"default": "Default value"
}
}Usage without CLI
TODO Document this feature.
See cli.js for an example on how this can be used directly.
