express-typescript-boilerplate
express-typescript-boilerplate copied to clipboard
class-validator not validating on routings-controllers
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.
You can use "@mardari/routing-controllers": "^0.7.9"
instead of official one until they release a fix.
Thx, I'll give a try
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 :)
importing class-validator from the routing controller package fixes the issue.
import { IsNotEmpty, Min } from 'routing-controllers/node_modules/class-validator';