Skip to content

Commit

Permalink
fix(query params mapping): fix for query params mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ValiDraganescu committed Apr 23, 2020
1 parent 8efe921 commit e30f143
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-openapi-router",
"version": "2.0.5",
"version": "2.0.6",
"description": "Multi purpose yet simple nodejs router with OpenAPI 3 compatibility for REST APIs",
"author": {
"name": "Vali Draganescu",
Expand Down
1 change: 1 addition & 0 deletions src/router/lambda-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export abstract class LambdaRouter {
path: event.path,
method: event.httpMethod as HttpMethod,
body: parsedBody,
queryParams: event.queryStringParameters
});
try {
return await getRouter().handleEvent(request);
Expand Down
1 change: 1 addition & 0 deletions src/router/request-opts.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ export interface IRequestOpts<RequestBody> {
method: HttpMethod;
body?: RequestBody;
pathParams?: IPathParams;
queryParams?: {[key: string]: string} | null;
}
2 changes: 1 addition & 1 deletion src/router/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Request<RequestBody = any> {
this.path = opts.path;
this.method = opts.method;
this.body = opts.body;
this.queryParams = this.getQueryParams();
this.queryParams = opts.queryParams ?? this.getQueryParams();
this.extra = {};
}

Expand Down

0 comments on commit e30f143

Please sign in to comment.