https://github.com/logisticinfotech/sails-hook-actions2-swagger
sailsjs hook swagger generator
https://github.com/logisticinfotech/sails-hook-actions2-swagger
actions2 sails-hook sails-hook-swagger sailsjs-action2 sailsjs-actions2-swagger sailsjs-swagger swagger-generator swagger-ui
Last synced: about 2 months ago
JSON representation
sailsjs hook swagger generator
- Host: GitHub
- URL: https://github.com/logisticinfotech/sails-hook-actions2-swagger
- Owner: logisticinfotech
- License: other
- Created: 2019-01-18T13:18:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-03T09:22:08.000Z (almost 6 years ago)
- Last Synced: 2025-04-23T21:06:54.498Z (about 2 months ago)
- Topics: actions2, sails-hook, sails-hook-swagger, sailsjs-action2, sailsjs-actions2-swagger, sailsjs-swagger, swagger-generator, swagger-ui
- Language: JavaScript
- Homepage: https://www.logisticinfotech.com/blog/sails-hook-actions2-swagger-generator/
- Size: 45.9 KB
- Stars: 6
- Watchers: 4
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### sails-hook-actions2-swagger
### Here is full article with step by step guidance [article](https://www.logisticinfotech.com/blog/sails-hook-actions2-swagger-generator).
A sails hook that generates swagger json with inputs of actions2 and provides swagger-ui.
We have recently added support for controllers that doesn't have actions input.### Installation
```
$ npm i @logisticinfotech/sails-hook-actions2-swagger
```After installation just `sails lift` and browse swagger doc at
http://localhost:1337/swagger (assuming that you are using localhost and default port)#### For [nodemon](https://nodemon.io/) users
use `nodemon --ignore 'swagger.json'` as we are generating swagger files in that folder we need to ignore that changes.### Change / Customize Default Options
Create swagger.js inside your config folder (config/swagger.js). Copy and paste all setting from default [swagger.js](https://github.com/logisticinfotech/sails-hook-actions2-swagger/blob/master/swagger.js) file.
You must declare **swaggerConfig** to work (for ex. module.exports.swaggerConfig = {})By default `disable: false`, you should disable it when it's not needed because this hook generates `swagger.json` on every `sails lift` you done.
You can update
- basePath
- externalDocs
- host
- contact
- parameters
- auth token header key
- version of api
and almost every thing from here.### For Usage and more details see my [blog](https://www.logisticinfotech.com/blog/sails-hook-actions2-swagger-generator).
### TODO
- File Upload