express-typescript-boilerplate icon indicating copy to clipboard operation
express-typescript-boilerplate copied to clipboard

class-validator not validating on routings-controllers

Open koka0012 opened this issue 6 years ago • 4 comments

class-validator is not running along with routings-controllers. You can test just by sending an api request with a missing field, they would say that field X doen't exist in table, they don't even pass to validation check.

koka0012 avatar Oct 15 '18 19:10 koka0012

You can use "@mardari/routing-controllers": "^0.7.9" instead of official one until they release a fix.

MardariG avatar Oct 24 '18 14:10 MardariG

Thx, I'll give a try

koka0012 avatar Oct 24 '18 23:10 koka0012

Hi! Are there any updates on this? I tried with:

You can use "@mardari/routing-controllers": "^0.7.9" instead of official one until they release a fix.

But still not working. To this specific project, is it enough to switch the standard routing-controllers, with yours @MardariG ? I can't get validation to work :(

Did it worked for you @koka0012 ? Thanks in advance :)

humbertowoody avatar Mar 05 '19 23:03 humbertowoody

importing class-validator from the routing controller package fixes the issue. import { IsNotEmpty, Min } from 'routing-controllers/node_modules/class-validator';

cesar3030 avatar Apr 12 '19 14:04 cesar3030