- class-transformer and class-validator are now peer dependencies.
- extract generic
@Session()deocorator into@SessionParam()and@Session()(ref [#335][#348][#407]) - restore/introduce
@QueryParams()and@Params()missing decorators options (ref [#289][#289]) - normalize param object properties (for "queries", "headers", "params" and "cookies"), with this change you can easily validate query/path params using
class-validator(ref [#289][#289]) - improved params normalization, converting to primitive types is now more strict and can throw ParamNormalizationError (e.g. when number is expected but an invalid string (NaN) has been received) (ref [#289][#289])
- feat(ErrorHandling): add support for custom toJSON method in errors (ref #325)
- fixed inconsistent roles parameter in authorizationChecker (ref #308)
- fixed bugs with undefined result code behaviour
- fixed bugs with undefined result code behaviour
- fixed bugs with undefined result code behaviour
- Support for returning Buffer and streams from action handler (controller's method) (ref #285)
- Custom driver support (ref #276)
- Directly calling response bug (ref #286)
- Missing parameter in @BodyParam error message (ref #284)
- Sync and async auth checker bug (ref (ref #283)
- Handling different content-type responses in JsonController (ref #277)
- Using
@Authorizationdecorator with Koa caused 404 responses (ref #240) - Allow throwing custom errors in
authorizationChecker(ref #233) - check auth permissions before accepting files for upload (ref #251)
- some routing-controllers options has been changed and renamed
- returned validation error value signature has changed
- controllers and middlewares now can be specified in routing-controllers options
MiddlewareInterfacewas removed and insteadExpressMiddlewareInterfaceorKoaMiddlewareInterfaceshould be usedExpressErrorMiddlewareInterfacewas renamed intoErrorMiddlewareInterface- per-controller and per-action middlewares used in
@UseBeforeand@UseAfternow should not be marked with@Middlewaredecorator @MiddlewareGlobalBefore()and@MiddlewareGlobalAfter()were removed and instead new signatures should be used:@Middleware({ type: "before" })and@Middleware({ type: "after" })- named some decorator parameter names
- added few new decorators to get all parameters like
@QueryParams,@Params,@HeaderParamsetc. - added
@Authorizedand@CurrentUserdecorators - added new
@Ctxdecorator to use context with koa @NullResultCodehas been renamed to@OnNull, now supports error classes@UndefinedResultCodehas been renamed to@OnUndefined, now supports error classes@EmptyResultCodehas been removed. Use@OnUndefineddecorator instead and return concrete types in your controllers.- added ability to create custom decorators
- enabled validation by default
- multiple bug fixes
- codebase refactoring
- removed
JsonResponseandTextResponsedecorators
- added integration with
class-transform-validatorfor deserialization and auto validation request parameters
- made interceptors to support promises
- added interceptors support
- middleware and error handlers support
- everything packed into "routing-controllers" main export
- added few more new decorators
- fixed multiple issues with param decorators
- fixed multiple bugs
- refactored core
- removed
parseJsonfrom@Bodydecorator - removed
ActionOptions - removed
responseTypefrom action options and added@JsonResponseand@TextResponsedecorators
- renamed package from
controllers.tstorouting-controllers - added integration with
constructor-utilsfor serialization and deserialization