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

Unwanted params #34

Closed RotemBot closed 4 years ago

RotemBot commented 6 years ago

I have an 'id' path param, which is dot defined anywhere and I'd like it gone.

Also, all my requests have a 'token' header. I would like to remove it, since I am using a specific Authorization header.

Here is my route definition:

'DELETE /api/v1/projects/:project_id' : {
    controller: 'ProjectController',
    action: 'destroy',
    swagger: {
      summary: 'Delete',
      description: 'Delete a project and all its dependents',
      parameters: [
        {
          in: 'header',
          name: 'Authorization',
          required: true,
          type: 'string',
          description: 'Bearer {{token}}'
        },
        {
          in: 'path',
          name: 'project_id',
          required: true,
          type: 'integer',
          description: 'ID of the project to delete'
        }
      ],
    }
  }

The Swagger UI output: image

theoomoregbee commented 4 years ago

see https://github.com/theoomoregbee/sails-hook-swagger-generator#configurations for ways to update generated specification before it outputs the .json