Giter Club home page Giter Club logo

sails-hook-actions2-swagger's Introduction

sails-hook-actions2-swagger

Here is full article with step by step guidance article.

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 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 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.

TODO

  • File Upload

sails-hook-actions2-swagger's People

Contributors

chintan13 avatar niravjadatiya avatar prashantkaria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sails-hook-actions2-swagger's Issues

When I use 'ref' in action2 input field type, an error occurs

Hi.

When I click the API in Swagger UI which has 'ref' field in action2 inputs, it shows loading icon without finishing. I could find the error message in Swagger UI in browser dev tool.

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'B.anyOf')

Could you check it please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.