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

ParseIntPipe in cats example not working correctly? (v5 beta) #592

Closed
lo78cn opened this issue Apr 23, 2018 · 3 comments
Closed

ParseIntPipe in cats example not working correctly? (v5 beta) #592

lo78cn opened this issue Apr 23, 2018 · 3 comments

Comments

@lo78cn
Copy link

lo78cn commented Apr 23, 2018

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

{"data":"string"}

Expected behavior

{"data":"number"}

Minimal reproduction of the problem with instructions

Download nest-master
extract zip file
cd sample/01-cats-app

change package.json

    "@nestjs/common": "^5.0.0-beta.3",
    "@nestjs/core": "^5.0.0-beta.3",
    "@nestjs/microservices": "^5.0.0-beta.3",
    "@nestjs/testing": "^5.0.0-beta.3",
    "@nestjs/websockets": "^5.0.0-beta.3",

change cats.controller.ts

@Get(':id')
  findOne(@Param('id', new ParseIntPipe()) id) {
    return typeof id;
  }
npm install
npm start
curl http://localhost:3000/cats/1

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

It should convert string to number.

Environment


Nest version: 5.0.0-beta.3

 
For Tooling issues:
- Node version: 8.9.1  
- Platform: Mac 

Others:

@kamilmysliwiec
Copy link
Member

Thanks for reporting. I'm on it

@kamilmysliwiec
Copy link
Member

Fixed in v5.0.0-beta.4. Let me know if you face any issue. 🙂

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants