[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
I have a route with two optional parameters, limit and page;
@Get()
@ApiImplicitParam({ name: 'page', required: false})
@ApiImplicitParam({ name: 'limit', required: false})
async index(
@Query('page') page: number = 1,
@Query('limit') limit: number = 10,
) {
limit = limit > 100 ? 100 : limit;
// implementation
}
In swagger when I try to run the request, none of my parameters are sent;
When I remove the @ApiImplicitParam decorator for both of the parameters they become required but are sent via swagger.
Swagger to sent the optional parameters when they are defined.
[System Information]
OS Version : Windows 7
NodeJS Version : v10.15.0
NPM Version : 6.4.1
For Tooling issues:
platform-express version : 6.5.2
passport version : 6.1.0
swagger version : 3.0.2
typeorm version : 6.1.2
common version : 6.5.2
core version : 6.5.2
jwt version : 6.1.1
Use @ApiImplicitQuery() instead of @ApiImplicitParam()
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Use
@ApiImplicitQuery()instead of@ApiImplicitParam()