diff --git a/README.md b/README.md index 2955ff4..a7c4719 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ module.exports = { // It is forbidden to read body from Req, eg: req.body 'authing-nestjs/forbid_read_body_from_req': 'warn', - // The parameter type annotation in the function must be a class + // The @Body type annotation in the function must be a class, eg: @Body() dto: ClassDto 'authing-nestjs/use_class_as_type_in_method_of_controller': 'warn', // Each DTO field must have a class validator diff --git a/src/rules/use-class-as-type-in-method-of-controller/use-class-as-type-in-method-of-controller.ts b/src/rules/use-class-as-type-in-method-of-controller/use-class-as-type-in-method-of-controller.ts index ef4ac67..c0b7cff 100644 --- a/src/rules/use-class-as-type-in-method-of-controller/use-class-as-type-in-method-of-controller.ts +++ b/src/rules/use-class-as-type-in-method-of-controller/use-class-as-type-in-method-of-controller.ts @@ -4,7 +4,8 @@ import { IContext, ITSInterfaceDeclaration, MethodDefinition, Pattern } from 'es const bodyParamMap = new Map() export const messages = { - invalidTypeAnnotation: 'The parameter type annotation in the function must be a class' + invalidTypeAnnotation: + 'The @Body type annotation in the function must be a class, eg: @Body() dto: ClassDto' } export const useClassAsTypeInMethodOfController = {