You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+[Creating your own express middleware](#creating-your-own-express-middleware)
@@ -509,10 +510,6 @@ If you specify a class type to parameter that is decorated with parameter decora
509
510
routing-controllers will use [class-transformer][4] to create instance of that class type.
510
511
More info about this feature is available [here](#creating-instances-of-classes-from-action-params).
511
512
512
-
#### Disable response transformation
513
-
514
-
By default response values are coerced to plain objects with [class-transformer](https://github.com/pleerock/class-transformer). When returning large objects or values with complex serialization logic (e.g. Mongoose documents) you might opt for the default `toJSON` handler instead. To disable response transformation simply pass `useResponseClassTransformer: false` to createExpressServer method.
To disable `class-transformer` on a per-controller or per-route basis, use the `transformRequest` and `transformResponse` options on your controller and route decorators:
You can use any exist express / koa middleware, or create your own.
@@ -1175,7 +1186,7 @@ If its a class - then instance of this class will be created.
1175
1186
This technique works not only with `@Body`, but also with `@Param`, `@QueryParam`, `@BodyParam` and other decorators.
1176
1187
Learn more about class-transformer and how to handle more complex object constructions [here][4].
1177
1188
This behaviour is enabled by default.
1178
-
If you want to disable it simply pass `classTransformer: false` to createExpressServer method.
1189
+
If you want to disable it simply pass `classTransformer: false` to createExpressServer method. Alternatively you can disable transforming for [individual controllers or routes](#selectively-disable-requestresponse-transforming).
0 commit comments