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
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -509,6 +509,10 @@ If you specify a class type to parameter that is decorated with parameter decora
509
509
routing-controllers will use [class-transformer][4] to create instance of that class type.
510
510
More info about this feature is available [here](#creating-instances-of-classes-from-action-params).
511
511
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.
515
+
512
516
#### Set custom ContentType
513
517
514
518
You can specify a custom ContentType header:
@@ -694,7 +698,7 @@ There are set of prepared errors you can use:
694
698
* UnauthorizedError
695
699
696
700
697
-
You can also create and use your own errors by extending `HttpError` class.
701
+
You can also create and use your own errors by extending `HttpError` class.
698
702
To define the data returned to the client, you could define a toJSON method in your error.
699
703
700
704
```typescript
@@ -716,7 +720,7 @@ class DbError extends HttpError {
716
720
}
717
721
}
718
722
}
719
-
```
723
+
```
720
724
721
725
#### Enable CORS
722
726
@@ -757,7 +761,7 @@ app.listen(3000);
757
761
758
762
#### Default settings
759
763
760
-
You can override default status code in routing-controllers options.
764
+
You can override default status code in routing-controllers options.
0 commit comments