We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Body decoration does not seem to be working
Example code:
import "reflect-metadata"; import { JsonController, Body, Post, createExpressServer } from "routing-controllers"; import { IsEmail, MinLength } from "class-validator"; class NewUserDto { @IsEmail() email: string; @MinLength(8) password: string; } @JsonController("/user") class UserController { @Post("/") createUser(@Body() user: NewUserDto) { return user; } } const app = createExpressServer({ controllers: [UserController] }); app.listen(8080, () => console.log("listening on port 8080"));
If I send a POST request to localhost:8080/user with the following JSON data
{ "email": "asdf", "password": "asdf" }
The server respondes with
instead of the expect 400 response I would expect since the email and password fields are invalid
My dependencies are:
"body-parser": "^1.18.3", "class-validator": "^0.9.1", "express": "^4.16.3", "reflect-metadata": "^0.1.12", "routing-controllers": "^0.7.7", "ts-node": "^7.0.0", "typescript": "^2.9.2"
The text was updated successfully, but these errors were encountered:
This is a clone of #384
Sorry, something went wrong.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
The Body decoration does not seem to be working
Example code:
If I send a POST request to localhost:8080/user with the following JSON data
The server respondes with
instead of the expect 400 response I would expect since the email and password fields are invalid
My dependencies are:
The text was updated successfully, but these errors were encountered: