1.4.1 • Published 6 years ago
json-schema-documentation-generator v1.4.1
JSON-Schema documentation generator
Philosophy
Unlike many documentation generator we want to delegate as much as possible the logic on the theme side. It might be perceived as quite an unusual move but the direct consequence is that you'll never be limited by an intermediate representation of your raw data.
Since the raw data will always be a valid JSON-schema (the generator first validate it), the data structure won't change for a defined json-schema draft version and your interface is thus guaranteed.
❤️ Shameless plug
Install
npm install json-schema-documentation-generator --save
Basic usage
// Code below will generate a
const generator = require('json-schema-documentation-generator');
generator({
input: {
// (required) json-schemas object list
schemas: [require('./my-schema.json'), require('./my-second-schema.json')],
// (required) schema sample generator
samples: {
generator: require('json-schema-documentation-sample-generator'),
},
},
output: {
// (required) visual theme
theme: require('json-schema-documentation-default-theme'),
// (optional) theme option
options:{
// (required) override this to specify another generator
directory: {
path: path.resolve(__dirname, 'static'),
},
},
},
}).then(
() => {
console.log('Documentation generated');
},
err => {
console.error('Could not generate documentation %s', err);
}
);
See full option
documentation parameter object.
Features
- schema samples
- theme support