Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom parameters are missing #46

Open
nagavenkatab opened this issue Dec 29, 2017 · 1 comment
Open

custom parameters are missing #46

nagavenkatab opened this issue Dec 29, 2017 · 1 comment

Comments

@nagavenkatab
Copy link

nagavenkatab commented Dec 29, 2017

With the current version of the npm package 0.51.0, the generated doc doesn't include the parameters specified for the routes.

['get /groups']: {
                    controller: 'authController',
                    action: 'login',
                    skipAssets: 'true',
                    //swagger path object
                    swagger: {
                        methods: ['GET'],

                        summary: ' Get Groups ',
                        description: 'Get Groups Description',
                        produces: [
                            'application/json'
                        ],
                        tags: [
                            'Groups'
                        ],
                        responses: {
                            '200': {
                                description: 'List of Groups',
                                schema: 'Group', //model,
                                type: 'array'
                            }
                        },
                        parameters: [{
                            "name": "id",
                            "in": "path",
                            "description": "ID of pet to use",
                            "required": true,
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "collectionFormat": "csv"
                        }, {
                            "name": "name",
                            "in": "query",
                            "description": "ID of pet to use",
                            "required": true,
                            "type": "string"
                        }, 'Contact']

                    }
                }

and the generated doc as below

 "/groups": {
      "get": {
        "summary": "Read Object(s)",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "The requested resource"
          },
          "404": {
            "description": "Resource not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "tags": [
          "auth"
        ]
      }
    }
@a4712020502
Copy link

a4712020502 commented May 15, 2018

I have the same problem with you.

'post /api/users/login': {
controller : 'UserController',
action: 'process2',
skipAssets: 'true',

    swagger: {
        methods: ['GET', 'POST'],
        summary: ' Get Groups ',
        description: 'Get Groups Description',
        body: {
            username: { type: 'string', required: true },
            password: { type: 'password', required: true }
        },
        parameters: [{
            in: 'query',
            name: 'firstName',
            required: true,
            type: 'string',
            description: 'This is a custom required parameter'
        }]

    }
}

but not take effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants