Coder Social home page Coder Social logo

catallog / dgeni-jsonschema Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 19 KB

A Dgeni package for generating JSON Schema from JSDoc documentation in source code

License: MIT License

JavaScript 100.00%
dgeni dgeni-package json jsonschema jsdoc documentation

dgeni-jsonschema's Introduction

dgeni-jsonschema

A Dgeni package for generating JSON Schema from JSDoc documentation in source code.

What does this do?

It uses the JSDoc markup to structure a JSON Schema and then renders it to the file. So, this anippet ...

/**
 * @name multyParameterComponent
 *
 * @description
 * Here goes this component description
 *
 * @param {string} title - title description
 * @param {int} counter - counter description
 * @param {string} [default-optional=defaultValue] - default-optional description
 * @param {array} list - list description
 * @param {array} [only-optional] - only-optional description
 *
 **/
const componentConfig = {
  bindings: {
    title: '@',
    counter: '@',
    defaultOptional: '@?',
    list: '<',
    onlyOptional: '<?'
  },
  controller: [ComponentController],
  templateUrl: templateUrl
};

... will be rendered as ...

{
  "type": "object",
  "title": "multyParameterComponent",
  "description": "Here goes this component description",
  "properties": {
    "title": {
      "type": "string",
      "description": "title description"
    },
    "counter": {
      "type": "int",
      "description": "counter description"
    },
    "default-optional": {
      "type": "string",
      "description": "default-optional description",
      "default": "defaultValue"
    },
    "list": {
      "type": "array",
      "description": "list description"
    },
    "only-optional": {
      "type": "array",
      "description": "only-optional description"
    }
  },
  "required": [
    "counter",
    "list",
    "title"
  ]
}

Dgeni configurations

Todos

  • Generate live example;
  • Provide more configurations samples.

dgeni-jsonschema's People

Contributors

basask avatar

Stargazers

NGUYEN HUYNH DUC avatar Pete Bacon Darwin avatar David Herges avatar  avatar Ariane Rocha avatar

Watchers

James Cloos avatar  avatar Thomas Alexander Ewald avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.