joi-md-doc
Generate markdown documentation files from @hapi/joi schemas.
Installation
npm i --save-dev joi-md-doc
Usage
const joi = ;const makeMarkdownDoc = ; const schema = joi object ; ;
API
makeMarkdownDoc(joiSchema[, options])
JoiSchema → undefined
Traverses a root joi object schema and generates a markdown documentation file of every nested object schema in the tree.
makeMarkdownByFilename(joiSchema)
JoiSchema → {String: String}
Meta Tags
filename
string
| required
The filename of each generated markdown file. Required for each joi object schema.
const schema = joiobject;
name
string
| optional | defaults to value offilename
The name/title of the markdown file.
const schema = joiobject;
default
*
| optional
The default value.
const schema = joiobject;
isDocumented
boolean
| optional | defaults totrue
Flag that determines whether or not a key is documented.
const schema = joiobject;
Example
Check out the example joi schema and generated markdown for currently supported joi validations.