{"action":"created","issue":{"url":"https://api.github.com/repos/nestjs/nest/issues/417","repository_url":"https://api.github.com/repos/nestjs/nest","labels_url":"https://api.github.com/repos/nestjs/nest/issues/417/labels{/name}","comments_url":"https://api.github.com/repos/nestjs/nest/issues/417/comments","events_url":"https://api.github.com/repos/nestjs/nest/issues/417/events","html_url":"https://github.com/nestjs/nest/issues/417","id":296736155,"number":417,"title":"@nestjs/common still depends on an old class-validator version","user":{"login":"fwoelffel","id":5467696,"avatar_url":"https://avatars2.githubusercontent.com/u/5467696?v=4","gravatar_id":"","url":"https://api.github.com/users/fwoelffel","html_url":"https://github.com/fwoelffel","followers_url":"https://api.github.com/users/fwoelffel/followers","following_url":"https://api.github.com/users/fwoelffel/following{/other_user}","gists_url":"https://api.github.com/users/fwoelffel/gists{/gist_id}","starred_url":"https://api.github.com/users/fwoelffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fwoelffel/subscriptions","organizations_url":"https://api.github.com/users/fwoelffel/orgs","repos_url":"https://api.github.com/users/fwoelffel/repos","events_url":"https://api.github.com/users/fwoelffel/events{/privacy}","received_events_url":"https://api.github.com/users/fwoelffel/received_events","type":"User","site_admin":false},"labels":[{"id":532263508,"url":"https://api.github.com/repos/nestjs/nest/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T13:26:52Z","updated_at":"2018-02-15T22:00:09Z","closed_at":"2018-02-15T22:00:09Z","author_association":"CONTRIBUTOR","body":"## I'm submitting a...\r\n<!-- \r\nPlease search GitHub for a similar issue or PR before submitting.\r\nCheck one of the following options with \"x\" -->\r\n<pre><code>\r\n[ ] Regression <!--(a behavior that used to work and stopped working in a new release)-->\r\n[x] Bug report\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.\r\n</code></pre>\r\n\r\n## Current behavior\r\n\r\nThe `@nestjs/common` is still depending on `class-validator: \"0.7.3\"`. See https://github.com/nestjs/nest/blob/master/lib/common/package.json\r\n\r\nThis version of `class-validator` doesn't support the whitelisting. This prevent the `ValidationPipe` to perform as expected when `{transform: true, whitelist: true}` is given as `ValidationPipeOptions`.\r\n\r\n`@nestjs/common` should depend on `class-validator: \"0.8.1\"`.\r\n\r\nSay I have this DTO:\r\n```js\r\nexport class SampleDTO {\r\n  readonly id: number;\r\n}\r\n```\r\n\r\nAnd this controller\r\n\r\n```js\r\n@Controller()\r\nexport class SampleCtrl {\r\n  @Post()\r\n  async sampleGet (\r\n    @Body(new ValidationPipe({ transform: true, whitelist: true })) payload: SampleDTO\r\n  ) {\r\n    return payload;\r\n  }\r\n}\r\n```\r\n\r\n```\r\ncurl -X POST \\\r\n  http://localhost:3000/ \\\r\n  -H 'content-type: application/json' \\\r\n  -d '{\r\n\t\"id\": 123,\r\n        \"extraneousProp\": \"REMOVE_ME_PLS\"\r\n}'\r\n\r\nHTTP 201\r\n{\r\n    \"id\": 123,\r\n    \"extraneousProp\": \"REMOVE_ME_PLS\"\r\n}\r\n```\r\n\r\n## Expected behavior\r\n\r\n```\r\ncurl -X POST \\\r\n  http://localhost:3000/ \\\r\n  -H 'content-type: application/json' \\\r\n  -d '{\r\n\t\"id\": 123,\r\n        \"extraneousProp\": \"REMOVE_ME_PLS\"\r\n}'\r\n\r\nHTTP 201\r\n{\r\n    \"id\": 123\r\n}\r\n```\r\n\r\nNote that the `extraneousProp` has been stripped of.\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\r\nSee above.\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n\r\nThe motivation here is to get the `ValidationPipe` working as expected.\r\n\r\n## Environment\r\n\r\n<pre><code>\r\nNest version: 4.6.0\r\n \r\nFor Tooling issues:\r\n- Node version: 8.9.4\r\n- Platform:  Linux\r\n\r\n</code></pre>\r\n"},"comment":{"url":"https://api.github.com/repos/nestjs/nest/issues/comments/366075785","html_url":"https://github.com/nestjs/nest/issues/417#issuecomment-366075785","issue_url":"https://api.github.com/repos/nestjs/nest/issues/417","id":366075785,"user":{"login":"kamilmysliwiec","id":23244943,"avatar_url":"https://avatars0.githubusercontent.com/u/23244943?v=4","gravatar_id":"","url":"https://api.github.com/users/kamilmysliwiec","html_url":"https://github.com/kamilmysliwiec","followers_url":"https://api.github.com/users/kamilmysliwiec/followers","following_url":"https://api.github.com/users/kamilmysliwiec/following{/other_user}","gists_url":"https://api.github.com/users/kamilmysliwiec/gists{/gist_id}","starred_url":"https://api.github.com/users/kamilmysliwiec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamilmysliwiec/subscriptions","organizations_url":"https://api.github.com/users/kamilmysliwiec/orgs","repos_url":"https://api.github.com/users/kamilmysliwiec/repos","events_url":"https://api.github.com/users/kamilmysliwiec/events{/privacy}","received_events_url":"https://api.github.com/users/kamilmysliwiec/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T22:00:09Z","updated_at":"2018-02-15T22:00:09Z","author_association":"OWNER","body":"Hi @fwoelffel,\r\nThanks. It's fixed in `v4.6.1` 🙂 "}}
{"actor":{"display_login":"kamilmysliwiec"}}