Skip to content

Latest commit

 

History

44 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

schematodoc Document

This library is used to generate document from a schema. The schema can be in a json file or in a yaml file. When a json schema is used, we get the documentation for the root key. When a yaml file is used, we get the documentation for a particular URL and it method.

Use with Node

$ npm install schematodoc

Usage

The module need to be executed from another js file. This module generates the documentation in a particular format. One can use that to get the document in the desired format.

To execute:

Please do install using npm install schematodoc and create a file test.js in the app root as shown below.

var gen = require('schematodoc');
var inputFile = './api/swagger/swagger.yaml'; //path to yaml file

var url = 'my_url';
var method = 'post';
gen.generateDocFromSwagger(inputFile, url, method, {save: true, outputFile: inputFile});

The generated documentation will be written in the given file.

One can customize the output according to one's needs. You have to create a function similar to the one : https://github.com/fastcodejava/schematodoc/blob/master/lib/generateOutput.js and supply the function as shown below :

gen.generateDocFromSwagger(inputFile, url, method, {save: true, outputFile: inputFile}, mygenFunc);
var gen = require('schematodoc');
var inputFile = './api/swagger/swagger.yaml'; //path to yaml file

var url = 'my_url';
var method = 'post';
gen.generateDocFromSwagger(inputFile, url, method, {save: false});

The generated documentation will be written in the console.

About

This library is used to generate document from a schema

Topics

Resources

Stars

5 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages