All Projects β†’ giddyinc β†’ mongoose-to-swagger

giddyinc / mongoose-to-swagger

Licence: MIT license
Conversion library for transforming Mongoose schema objects into Swagger schema definitions.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mongoose-to-swagger

Pdoc
🐍 ➑️ πŸ“œ Auto-generate API documentation for Python projects
Stars: ✭ 604 (+1108%)
Mutual labels:  docs, documentation-tool
Vuesence Book
Minimalistic Vue.js based documentation system component
Stars: ✭ 48 (-4%)
Mutual labels:  docs, documentation-tool
Devdocs
API Documentation Browser
Stars: ✭ 27,208 (+54316%)
Mutual labels:  docs, documentation-tool
idoc
πŸ“’πŸ“šGenerate beautiful interactive documentation and Open-API 3.0 spec file from your existing Laravel app.
Stars: ✭ 95 (+90%)
Mutual labels:  docs, open-api-specification
Jekyll Rtd Theme
Just another documentation theme compatible with GitHub Pages
Stars: ✭ 92 (+84%)
Mutual labels:  docs, documentation-tool
Docsify
πŸƒ A magical documentation site generator.
Stars: ✭ 19,310 (+38520%)
Mutual labels:  docs, documentation-tool
App
Fast and searchable Ruby docs
Stars: ✭ 47 (-6%)
Mutual labels:  docs, documentation-tool
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+42458%)
Mutual labels:  openapi-specification, swagger-js
Docpht
With DocPHT you can take notes and quickly document anything and without the use of any database.
Stars: ✭ 90 (+80%)
Mutual labels:  docs, documentation-tool
Community
Modern Confluence alternative designed for internal & external docs, built with Golang + EmberJS
Stars: ✭ 1,286 (+2472%)
Mutual labels:  docs, documentation-tool
metadoc.js
Generates JSON metadata for Object Oriented JavaScript libraries. Used as a source for generating documentation.
Stars: ✭ 20 (-60%)
Mutual labels:  docs, documentation-tool
chappe
πŸ§‘β€πŸ’» Developer Docs builder. Write guides in Markdown and references in API Blueprint. Comes with a built-in search engine.
Stars: ✭ 132 (+164%)
Mutual labels:  docs, documentation-tool
Redoc
πŸ“˜ OpenAPI/Swagger-generated API Reference Documentation
Stars: ✭ 15,935 (+31770%)
Mutual labels:  documentation-tool, openapi-specification
The Documentation Compendium
πŸ“’ Various README templates & tips on writing high-quality documentation that people want to read.
Stars: ✭ 4,306 (+8512%)
Mutual labels:  docs, documentation-tool
Swagger Js
Javascript library to connect to swagger-enabled APIs via browser or nodejs
Stars: ✭ 2,319 (+4538%)
Mutual labels:  openapi-specification, swagger-js
Pdoc
API Documentation for Python Projects
Stars: ✭ 853 (+1606%)
Mutual labels:  docs, documentation-tool
Zeal
Offline documentation browser inspired by Dash
Stars: ✭ 9,164 (+18228%)
Mutual labels:  docs, documentation-tool
Catalog
Create living style guides using Markdown or React
Stars: ✭ 1,527 (+2954%)
Mutual labels:  docs, documentation-tool
buuk
A simple markdown based documentation generator.
Stars: ✭ 23 (-54%)
Mutual labels:  docs, documentation-tool
Express-MongoDB-Authentication
A simple authentication app using Express & MongoDB
Stars: ✭ 15 (-70%)
Mutual labels:  mongoose

NPM version Build Status Coverage Status

mongoose-to-swagger

Conversion library for transforming Mongoose schema objects into Swagger schema definitions.

Installation

$ npm install --save mongoose-to-swagger

Overview

Converts a mongoose model into a swagger schema.

Usage

const mongoose = require('mongoose');
const m2s = require('mongoose-to-swagger');
const Cat = mongoose.model('Cat', { name: String });
const swaggerSchema = m2s(Cat);
console.log(swaggerSchema);

Meta properties

By default, description, enum, and required fields are extracted from the mongoose schema definitions and placed into the correspoding swagger properties definitions. Additional meta props can be whitelisted using the props array on the options argument.

const Cat = mongoose.model('Cat', { 
    name: {
        type: String,
        /**
         * Custom Properties
         * `description` is enabled by default
         */
        description: 'Name of the cat', // description is enabled by default
        bar: 'baz' // custom prop
    },
    color: String
});

const options = { 
    /**
     * Whitelist of custom meta fields.
     */
    props: ['bar'],
    /**
     * Fields to omit from model root. "__v" and "id" are omitted by default with omitMongooseInternals (default: true)
     */
    omitFields: ['_id', 'color'], 
    /**
     * Omit mongoose internals, omits mongoose internals from result ("__v", "id" - mongoose version field and virtual id field) (default: true)
     */
    omitMongooseInternals: false
};

const swaggerSchema = m2s(Cat, options);

Contributing

We look forward to seeing your contributions!

License

MIT Β© Ben Lugavere

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].