{"id":13609586,"url":"https://github.com/trailsjs/sails-swagger","last_synced_at":"2025-04-23T05:26:47.403Z","repository":{"id":31329432,"uuid":"34891979","full_name":"trailsjs/sails-swagger","owner":"trailsjs","description":"Swagger integration for sails.js","archived":false,"fork":false,"pushed_at":"2016-12-12T13:36:46.000Z","size":65,"stargazers_count":109,"open_issues_count":21,"forks_count":47,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-17T20:40:03.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trailsjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-01T06:17:06.000Z","updated_at":"2025-03-23T17:36:42.000Z","dependencies_parsed_at":"2022-09-09T07:01:02.825Z","dependency_job_id":null,"html_url":"https://github.com/trailsjs/sails-swagger","commit_stats":null,"previous_names":["tjwebb/sails-swagger"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailsjs%2Fsails-swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailsjs%2Fsails-swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailsjs%2Fsails-swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailsjs%2Fsails-swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trailsjs","download_url":"https://codeload.github.com/trailsjs/sails-swagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250375764,"owners_count":21420189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:36.227Z","updated_at":"2025-04-23T05:26:47.380Z","avatar_url":"https://github.com/trailsjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# sails-swagger\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][ci-image]][ci-url]\n[![Dependency Status][daviddm-image]][daviddm-url]\n[![Code Climate][codeclimate-image]][codeclimate-url]\n\n\n[swagger.io](http://swagger.io/) (v2.0) hook for Sails. The application's models, controllers, and routes are aggregated and transformed into a Swagger Document. Supports the Swagger 2.0 specification.\n\n## Install\n\n```sh\n$ npm install sails-swagger --save\n```\n\n## Configuration\n```js\n// config/swagger.js\nmodule.exports.swagger = {\n  /**\n   * require() the package.json file for your Sails app.\n   */\n  pkg: require('../package'),\n  ui: {\n    url: 'http://swagger.balderdash.io'\n  }\n};\n```\n\n## Usage\nAfter installing and configuring swagger, you can find the docs output on the [/swagger/doc](http://localhost:1337/swagger/doc) route.\n\nYou may also specify additional swagger endpoints by specifying the swagger spec in config/routes.js\n\n```\n/**\n * Route Mappings\n * @file config/routes.js\n * (sails.config.routes)\n *\n * Your routes map URLs to views and controllers.\n */\n\nmodule.exports.routes = {\n\n    /***************************************************************************\n     *                                                                          *\n     * Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *\n     * etc. depending on your default view engine) your home page.              *\n     *                                                                          *\n     * (Alternatively, remove this and add an `index.html` file in your         *\n     * `assets` directory)                                                      *\n     *                                                                          *\n     ***************************************************************************/\n\n    '/': {\n        view: 'homepage'\n    },\n\n    /***************************************************************************\n     *                                                                          *\n     * Custom routes here...                                                    *\n     *                                                                          *\n     * If a request to a URL doesn't match any of the custom routes above, it   *\n     * is matched against Sails route blueprints. See `config/blueprints.js`    *\n     * for configuration options and examples.                                  *\n     *                                                                          *\n     ***************************************************************************/\n    'get /groups/:id': {\n        controller: 'GroupController',\n        action: 'test',\n        skipAssets: 'true',\n        //swagger path object\n        swagger: {\n            methods: ['GET', 'POST'],\n            summary: ' Get Groups ',\n            description: 'Get Groups Description',\n            produces: [\n                'application/json'\n            ],\n            tags: [\n                'Groups'\n            ],\n            responses: {\n                '200': {\n                    description: 'List of Groups',\n                    schema: 'Group', // api/model/Group.js,\n                    type: 'array'\n                }\n            },\n            parameters: []\n\n        }\n    },\n    'put /groups/:id': {\n        controller: 'GroupController',\n        action: 'test',\n        skipAssets: 'true',\n        //swagger path object\n        swagger: {\n            methods: ['PUT', 'POST'],\n            summary: 'Update Groups ',\n            description: 'Update Groups Description',\n            produces: [\n                'application/json'\n            ],\n            tags: [\n                'Groups'\n            ],\n            responses: {\n                '200': {\n                    description: 'Updated Group',\n                    schema: 'Group' // api/model/Group.js\n                }\n            },\n            parameters: [\n                'Group' // api/model/Group.js\n            ]\n\n        }\n    }\n};\n\n\n```\n\n## License\nMIT\n\n## Maintained By\n[\u003cimg src='http://i.imgur.com/Y03Jgmf.png' height='64px'\u003e](http://langa.io)\n\n[sails-version-image]: https://goo.gl/gTUV5x\n[sails-url]: http://sailsjs.org\n[npm-image]: https://img.shields.io/npm/v/sails-swagger.svg?style=flat\n[npm-url]: https://npmjs.org/package/sails-swagger\n[ci-image]: https://img.shields.io/travis/langateam/sails-swagger/master.svg?style=flat\n[ci-url]: https://travis-ci.org/langateam/sails-swagger\n[daviddm-image]: http://img.shields.io/david/langateam/sails-swagger.svg?style=flat\n[daviddm-url]: https://david-dm.org/langateam/sails-swagger\n[codeclimate-image]: https://img.shields.io/codeclimate/github/langateam/sails-swagger.svg?style=flat\n[codeclimate-url]: https://codeclimate.com/github/langateam/sails-swagger\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailsjs%2Fsails-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrailsjs%2Fsails-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailsjs%2Fsails-swagger/lists"}