express-cassandra-swagger

1.1.1 • Public • Published

express-cassandra-swagger

Build Status Coverage Status js-semistandard-style Dependency Status npm

Swagger definition generator for Express-Cassandra models. Forked from 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.

Package Sidebar

Install

npm i express-cassandra-swagger

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

11.9 kB

Total Files

9

Last publish

Collaborators

  • dekelev