-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Should ParseArrayPipe with String items treat it as JSON? #11173
Comments
Would you like to create a PR for this issue? |
@thgh You are right below I shared the link of the code that is actually doing this. So you will be not wasting time on finding. Have a nice day. https://github.com/nestjs/nest/blob/master/packages/common/pipes/parse-array.pipe.ts#L92 |
Haha, same thinking here |
Here is the PR: #11170 I'm not sure what the expected outcome is though. Can I remove the JSON.parse? Or fiddle until the tests pass? |
given Would you like to open a PR to address this? |
I think we can remove |
Alright, the new behaviour has been pushed to #11170 |
Let's track this here #11170 |
Is there an existing issue for this?
Current behavior
new ParseArrayPipe({ items: String })
interprets each item as JSON and then stringifies it which potentially modifies itMinimum reproduction code
See below or #11170
Steps to reproduce
Expected behavior
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
9
Packages versions
core version : 9.3.9
Node.js version
16
In which operating systems have you tested?
Other
The behaviour is untested, so I added the case in #11170
The text was updated successfully, but these errors were encountered: