Skip to content

auto validtion not working  #705

@hatemragab

Description

@hatemragab
@JsonController()
class UserController {
    @Post('/login')
    login(@Body({validate: true}) user: User) {
        console.log('this is a valid body');
        return 'success!!!';
    }
}

class User {
    @IsEmail()
    email: string;

    @MinLength(6)
    password: string;
}

createExpressServer({
    controllers: [UserController]
}).listen(3000);

when ever I send the request it reply
console.log('this is a valid body');
although
this my config

useExpressServer(app, {
  cors: true,
  validation: true,
  classTransformer: true,
  routePrefix: '/api/v1',

  controllers: [UserController],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions