Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/catallog/dgeni-jsonschema
A Dgeni package for generating JSON Schema from JSDoc documentation in source code
https://github.com/catallog/dgeni-jsonschema
dgeni dgeni-package documentation jsdoc json jsonschema
Last synced: about 2 months ago
JSON representation
A Dgeni package for generating JSON Schema from JSDoc documentation in source code
- Host: GitHub
- URL: https://github.com/catallog/dgeni-jsonschema
- Owner: catallog
- License: mit
- Created: 2017-02-17T16:26:51.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T12:51:34.000Z (almost 8 years ago)
- Last Synced: 2024-09-14T14:06:03.619Z (4 months ago)
- Topics: dgeni, dgeni-package, documentation, jsdoc, json, jsonschema
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dgeni-jsonschema
A [Dgeni](https://github.com/angular/dgeni) package for generating [JSON Schema](http://json-schema.org/) from [JSDoc](http://usejsdoc.org/) 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 ...``` javascript
/**
* @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 ...
```json
{
"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
- [basic_schema/dgeni-conf.js](./tests/basic_schema/dgeni-conf.js)# Todos
- Generate live example;
- Provide more configurations samples.