theoomoregbee / sails-hook-swagger-generator

A tool to help generate Swagger specification documentation based on OAS 3.0 for Sails APIs
MIT License
78 stars 33 forks source link

feat: added custom parameter addition from routes.js directly #16

Closed anasuya1117 closed 6 years ago

anasuya1117 commented 6 years ago

It will allow us to add parameters to our custom routes like this,

     'POST /client': {
     controller: 'ClientController',
        action: 'createClient',
        swagger: {
        summary: 'Client creation',
        description: 'This is for creating client for HMAC Authentication',
        parameters: [
          {
            name: 'name',
            type: 'string'
          },
          {
            name: 'url',
            type: 'string',
            description: 'testing desc'
          }
        ]
        }
      },

This change will enable us to create parameter with personalized name,type ,in,required and description

theoomoregbee commented 6 years ago

nice going through this BEOD

theoomoregbee commented 6 years ago

if its what you can take on, np, or i add it to the next release feature

theoomoregbee commented 6 years ago

don't worry about the commitlint, may be from next commit you should follow conventional commit message https://github.com/theo4u/sails-hook-swagger-generator#contribute

anasuya1117 commented 6 years ago

@theo4u kindly let me know what changes I should do to make it acceptable for merging

theoomoregbee commented 6 years ago

@anasuya1117 just understanding what you tried to do anyway, just use same parameter key if you want to override the default parameters, and add test, i think that should make it perfect 👌 . thanks

theoomoregbee commented 6 years ago

@anasuya1117 test is failing https://travis-ci.org/theo4u/sails-hook-swagger-generator/builds/344764598?utm_source=github_status&utm_medium=notification

anasuya1117 commented 6 years ago

Updated the test cases @theo4u

anasuya1117 commented 6 years ago

Updated the readme @theo4u