Skip to content

Commit 778ea0b

Browse files
author
Aleksi Pekkala
committed
Implement TransformationOptions instead of extending it in controller/action options
1 parent be17c80 commit 778ea0b

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

src/TransformationOptions.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import {TransformationOptions} from "../TransformationOptions";
2-
31
/**
42
* Extra options that apply to each controller action.
53
*/
6-
export interface ControllerOptions extends TransformationOptions {
4+
export interface ControllerOptions {
5+
/**
6+
* If set to false, class-transformer won't be used to perform request serialization.
7+
*/
8+
transformRequest?: boolean;
79

10+
/**
11+
* If set to false, class-transformer won't be used to perform response serialization.
12+
*/
13+
transformResponse?: boolean;
814
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import {TransformationOptions} from "../TransformationOptions";
2-
31
/**
42
* Extra handler-specific options.
53
*/
6-
export interface HandlerOptions extends TransformationOptions {
4+
export interface HandlerOptions {
5+
/**
6+
* If set to false, class-transformer won't be used to perform request serialization.
7+
*/
8+
transformRequest?: boolean;
79

10+
/**
11+
* If set to false, class-transformer won't be used to perform response serialization.
12+
*/
13+
transformResponse?: boolean;
814
}

0 commit comments

Comments
 (0)