Skip to content

Commit

Permalink
feature(request raw body): now the Request object also has the raw, u…
Browse files Browse the repository at this point in the history
…nparsed body of the request
  • Loading branch information
ValiDraganescu committed Aug 28, 2020
1 parent 02d89d1 commit 3852b03
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
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.1.1",
"version": "2.1.2",
"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,
rawBody: event.body,
queryParams: event.queryStringParameters
});
try {
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 @@ -22,6 +22,7 @@ export interface IRequestOpts<RequestBody> {
path: string;
method: HttpMethod;
body?: RequestBody;
rawBody?: string | null;
pathParams?: IPathParams;
queryParams?: {[key: string]: string} | null;
}
1 change: 1 addition & 0 deletions src/router/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class Request<RequestBody = any> {
path: string;
method: HttpMethod;
body?: RequestBody;
rawBody?: string | null;
pathParams?: IPathParams | null;
queryParams?: IQueryParams | null;
extra: { [key: string]: any };
Expand Down

0 comments on commit 3852b03

Please sign in to comment.