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
ValidationPipe sets "undefined" for Boolean parameter if not provided #12818
Comments
that's expected and it was a breaking change, as I described in that PR. That's why it was introduced in v10, not in v9 you should supply a default value, like with the others pipe |
btw that has nothing to do with it just for |
I wonder how many unexpected runtime issues like this I will face in v10. |
feel free to add it in that page |
Actually thank you, now I see the full list of such possible changes. Thank you for a quick response. |
actually, in your case, you should see a validation error (400 bad request), not can you provide a minimum repro? |
Yes, I see a validation error. |
That's risky breaking change, cause it reveals only in runtime. |
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
PR #10953
NestJS version
9.4.3 -> 10.2.10
Describe the regression
I encountered a breaking change while migrating to the new major version of Nest.js.
In version 9.4.3, the ParseBoolPipe from "@nestjs/common" used to set a parameter's value to "false" if it was not provided. Starting from version 10.0.0, the ValidationPipe::transformPrimitive() now sets a Boolean parameter to "undefined."
Unfortunately, this change is not mentioned in the Nest.js migration guide https://docs.nestjs.com/migration-guide and is not highlighted in the release notes.
Minimum reproduction code
No response
Input code
Expected behavior
Endpoints returns "data".
Other
No response
The text was updated successfully, but these errors were encountered: