# sails-swaggify

> creates swagger doc json for your sails routes

Latest version **0.0.2** (published 2016-06-22) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install sails-swaggify
pnpm add sails-swaggify
yarn add sails-swaggify
bun add sails-swaggify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-06-22 |
| First published | 2016-06-22 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dirwin517 |
| Maintainers | dirwin517 |
| Keywords | sails, swagger, swaggify, api, documentation |

## Links

- npm: https://www.npmjs.com/package/sails-swaggify
- Repository: https://github.com/arupex/sails-swaggify
- Homepage: https://github.com/arupex/sails-swaggify#readme
- Issues: https://github.com/arupex/sails-swaggify/issues
- npm.io page: https://npm.io/package/sails-swaggify

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-06-22
- 0.0.1 — 2016-06-22

## README

# sails-swaggify
Make Swagger Docs for Sails App in a way that interspects sails routes, but gives you a clean callback function to call in your controller


[![npm version](https://badge.fury.io/js/sails-swaggify.svg)](https://badge.fury.io/js/sails-swaggify) [![dependencies](https://david-dm.org/arupex/sails-swaggify.svg)](http://github.com/arupex/sails-swaggify) ![Build Status](https://api.travis-ci.org/arupex/sails-swaggify.svg?branch=master) <a href='https://pledgie.com/campaigns/31873'><img alt='Pledge To Arupex!' src='https://pledgie.com/campaigns/31873.png?skin_name=chrome' border='0' ></a>


#Install

    npm install sails-swaggify --save

#Usage

#In a Controller

    module.exports = {

      getSwagger : function(req, res){
        SwaggerService.getSwagger(this, res.swagger);
      }

    };

#In your Routes

    /**
     * Route Mappings
     * @file config/routes.js
     * (sails.config.routes)
     *
     * Your routes map URLs to views and controllers.
     */

    module.exports.routes = {

        '/': {
            view: 'homepage'
        },

        'get /groups/:id': {
            controller: 'GroupController',
            action: 'test',
            skipAssets: 'true',
            //swagger path object
            swagger: {
                methods: ['GET', 'POST'],
                summary: ' Get Groups ',
                description: 'Get Groups Description',
                produces: [
                    'application/json'
                ],
                tags: [
                    'Groups'
                ],
                responses: {
                    '200': {
                        description: 'List of Groups',
                        schema: 'Group', // api/model/Group.js,
                        type: 'array'
                    }
                },
                parameters: []

            }
        },
        'put /groups/team': {
            controller: 'GroupController',
            action: 'test',
            skipAssets: 'true',
            //swagger path object
            swagger: {
                methods: ['PUT', 'POST'],
                summary: 'Update Groups ',
                description: 'Update Groups Description',
                produces: [
                    'application/json'
                ],
                tags: [
                    'Groups'
                ],
                responses: {
                    '200': {
                        description: 'Updated Group',
                        schema: 'Group' // api/model/Group.js
                    }
                },
                parameters: [
                    'Group' // api/model/Group.js
                ]

            }
        }
    };

---
_Source: https://npm.io/package/sails-swaggify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
