Closed
Description
I have the following and are using v. 0.7.6 of routing-controllers:
export class TestObject {
@IsNumber()
@IsPositive()
someNumber: number;
@IsString()
@IsNotEmpty()
someString: string;
}
@Controller('/v1/test')
export class PaymentController {
@Get()
getTest( @QueryParams() test: TestObject) {
console.log(test);
return 'ok';
}
}
I would expect that a url like "v1/test?someNumber=notanumber" would cause the user to get a bad request 400 response (as "notanumber" is not a positive number and as "someString" is missing) or at least cause some kind of error somewhere. But nothing happens. The request goes through, the object will be printed and 200 is returned.
Am I missing something here?
Kind regards Morten
Metadata
Metadata
Assignees
Labels
No labels