Skip to content

cdmgtri/json-schema-to-jsdoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Schema to JSDoc

Useful when you already have a JSON Schema and want to document the types you want to validate. Works with subschema definitions.

Usage

const jsdoc = require('json-schema-to-jsdoc');

const schema = {
  "id": "Person",
  "type": "object",
  "properties": {
    "name": {"type": "string", "description": "A person's name"},
    "age": {"type": "integer", "description": "A person's age"}
  },
  "required" : ["name"]
}

jsdoc(schema);

Output

/** 
  * Represents a Person object
  *
  * @property {string} name - A person's name
  * @property {integer} [age] - A person's age
  */

About

Generate JSDocs from JSON Schema

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%