Skip to content
New issue

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

Child objects aren't processed by ValidationPipe #567

Open
ronniehicks opened this issue Apr 20, 2021 · 3 comments
Open

Child objects aren't processed by ValidationPipe #567

ronniehicks opened this issue Apr 20, 2021 · 3 comments

Comments

@ronniehicks
Copy link

I'm submitting a...


[ ] Regression 
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When providing a child to a @Body() parameter while using a global ValidationPipe the child object is not processed correctly and an "invalid" child object can make it through the validation pipe.

Expected behavior

Child objects will be inspected and blocked through the validation pipe

Minimal reproduction of the problem with instructions

Once you've cloned this repo post an invalid child object(s) to the POST /api/release endpoint.

What is the motivation / use case for changing the behavior?

This can't be correct behavior.

Environment


Nest version: 7.6.0

 
For Tooling issues:
- Node version: v14.16.1  
- Platform:  Mac/WSL 

Others:

VSCode 1.55.2
npm
Angular 11.2.10
@ronniehicks
Copy link
Author

Oh, and as a follow up (let me know if you want me to create a different issue for this) if you attempt to hit an API endpoint that doesn't exist the calling client (Postman) doesn't get a 404 it just keeps trying

@kamilmysliwiec
Copy link
Member

Can you share an example of an "invalid" object?

@ronniehicks
Copy link
Author

ronniehicks commented Jun 25, 2021

{
  "name": "something",
  "track": {
    "name": "else"
  }
}

It's been awhile, but based on the example repo provided, that should be an invalid object (missing ordinal on track).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants