https://github.com/dekelev/express-cassandra-swagger
JSON schema YAML generator for Express-Cassandra models. Intended to be used together with automatic Swagger generators
https://github.com/dekelev/express-cassandra-swagger
express-cassandra json json-schema model schema swagger yaml
Last synced: 3 months ago
JSON representation
JSON schema YAML generator for Express-Cassandra models. Intended to be used together with automatic Swagger generators
- Host: GitHub
- URL: https://github.com/dekelev/express-cassandra-swagger
- Owner: dekelev
- License: mit
- Created: 2020-04-11T11:36:16.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T21:40:45.000Z (almost 2 years ago)
- Last Synced: 2025-01-04T13:18:16.374Z (5 months ago)
- Topics: express-cassandra, json, json-schema, model, schema, swagger, yaml
- Language: JavaScript
- Homepage:
- Size: 590 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# express-cassandra-swagger
[](https://travis-ci.org/dekelev/express-cassandra-swagger)
[](https://coveralls.io/github/dekelev/express-cassandra-swagger?branch=master)
[](https://github.com/standard/semistandard)
[](https://david-dm.org/dekelev/express-cassandra-swagger)
[](https://www.npmjs.com/package/express-cassandra-swagger)Swagger definition generator for Express-Cassandra models. Forked from [objection-swagger](https://github.com/kibertoad/objection-swagger).
```
/**
* @typedef {Object} GeneratedSwaggerYaml
* @property {string} name Name of the model
* @property {string} schema JSON schema in YAML format
*//**
* Generates JSON schemas for inclusion in Swagger specifications from Express-Cassandra models
* @param {Model|Model[]} modelParam - model(s) to generate schemas for
* @param {Options} opts
* @returns {GeneratedSwaggerYaml[]} generated JSON schemas as strings (in YAML format)
*/
function generateSchema(modelParam, opts = {})
``````
/**
* @typedef {Object} GeneratedSwagger
* @property {string} name Name of the model
* @property {Object} schema JSON schema
*//**
* Generates JSON schemas from Express-Cassandra models
* @param {Model|Model[]} modelParam - model(s) to generate schemas for
* @param {Options} opts
* @returns {GeneratedSwagger[]} generated JSON schemas as objects
*/
function generateSchemaRaw(modelParam, opts = {})
``````
/**
* Generates and saves into specified directory JSON schema files for inclusion in Swagger specifications from given
* Express-Cassandra models
* @param {Model|Model[]} modelParam - model(s) to generate schemas for
* @param {string} targetDir - directory to write generated schemas to. Do not add '/' to the end.
* @param {Options} opts
* @returns {Promise} - promise that is resolved after schemas are written
*/
function saveSchema(modelParam, targetDir, opts = {})
```## License
Licensed under the [MIT license](LICENSE).