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

Headers #60

Open
Ankit1995-appinventiv opened this issue May 8, 2020 · 1 comment
Open

Headers #60

Ankit1995-appinventiv opened this issue May 8, 2020 · 1 comment

Comments

@Ankit1995-appinventiv
Copy link

How can i accept headers like device token.

@thinkingmik
Copy link
Collaborator

With swagger-express-ts:v1.1.0 you can now specify headers params

  @ApiOperationGet({
        path: `/mypath/{name}`,
        summary: 'Execute a custom view',
        parameters: {
            header: {
                'x-device-token': {
                    description: 'The device token',
                    type: SwaggerDefinitionConstant.Parameter.Type.STRING,
                    required: true,
                },
            },
            path: {
                name: {
                    description: 'The view name',
                    type: SwaggerDefinitionConstant.Parameter.Type.STRING,
                    required: true,
                },
            },
        },
        responses: {
            200: {
                description: 'Success',
                type: SwaggerDefinitionConstant.Response.Type.OBJECT,
            }
        }
    })

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