{"action":"created","issue":{"url":"https://api.github.com/repos/typestack/class-validator/issues/146","repository_url":"https://api.github.com/repos/typestack/class-validator","labels_url":"https://api.github.com/repos/typestack/class-validator/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/typestack/class-validator/issues/146/comments","events_url":"https://api.github.com/repos/typestack/class-validator/issues/146/events","html_url":"https://github.com/typestack/class-validator/issues/146","id":280843519,"node_id":"MDU6SXNzdWUyODA4NDM1MTk=","number":146,"title":"TypeError: Cannot read property 'prototype' of undefined","user":{"login":"idchlife","id":4563032,"node_id":"MDQ6VXNlcjQ1NjMwMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/4563032?v=4","gravatar_id":"","url":"https://api.github.com/users/idchlife","html_url":"https://github.com/idchlife","followers_url":"https://api.github.com/users/idchlife/followers","following_url":"https://api.github.com/users/idchlife/following{/other_user}","gists_url":"https://api.github.com/users/idchlife/gists{/gist_id}","starred_url":"https://api.github.com/users/idchlife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idchlife/subscriptions","organizations_url":"https://api.github.com/users/idchlife/orgs","repos_url":"https://api.github.com/users/idchlife/repos","events_url":"https://api.github.com/users/idchlife/events{/privacy}","received_events_url":"https://api.github.com/users/idchlife/received_events","type":"User","site_admin":false},"labels":[{"id":268336167,"node_id":"MDU6TGFiZWwyNjgzMzYxNjc=","url":"https://api.github.com/repos/typestack/class-validator/labels/type:%20fix","name":"type: fix","color":"d93f0b","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-12-10T20:50:05Z","updated_at":"2018-06-13T17:35:39Z","closed_at":"2018-03-02T08:46:59Z","author_association":"NONE","body":"Error appears here: https://github.com/typestack/class-validator/blob/master/src/metadata/MetadataStorage.ts#L79\r\n\r\nEverything is quiet ordinar. I have this class for validation:\r\n\r\n```typescript\r\nexport class RegisterMasterBody {\r\n  @IsEmail()\r\n  email: string;\r\n\r\n  @MinLength(6)\r\n  password: string;\r\n\r\n  name: string;\r\n\r\n  instagram?: string;\r\n\r\n  description?: string;\r\n\r\n  lat?: number;\r\n\r\n  long?: number;\r\n}\r\n```\r\n\r\nAnd here how I check for errors:\r\n\r\n```typescript\r\n@Post()\r\n  @Render(\"register\")\r\n  public async register(@Res() res: Response, @Body() body: RegisterMasterBody) {\r\n    try {\r\n      console.log(body, typeof body, body.constructor);\r\n      const errors = await validate(body, { skipMissingProperties: true });\r\n      console.log(errors, \"errors of validate\");\r\n    } catch (error) {\r\n      console.error(error, \"POST REGISTER\");\r\n    }\r\n  }\r\n```\r\n\r\nin console.log typeof body - \"object\", constructor undefined\r\n\r\nBut inside here Error appears here: https://github.com/typestack/class-validator/blob/master/src/metadata/MetadataStorage.ts#L79 metadata.target is RegisterMasterBody\r\n\r\nI tried to gather as much info as I can, since this is another project full of everything to strip it down and create repo with isolated reproduction :(\r\n\r\nClass validator is the same version as in this repo.\r\n\r\nedit: worth mention - there are more properties that do not belong to RegisterMasterBody coming in request. But I tried adding them to RegisterMastBody - did not help"},"comment":{"url":"https://api.github.com/repos/typestack/class-validator/issues/comments/397022483","html_url":"https://github.com/typestack/class-validator/issues/146#issuecomment-397022483","issue_url":"https://api.github.com/repos/typestack/class-validator/issues/146","id":397022483,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzAyMjQ4Mw==","user":{"login":"theobouwman","id":16098190,"node_id":"MDQ6VXNlcjE2MDk4MTkw","avatar_url":"https://avatars2.githubusercontent.com/u/16098190?v=4","gravatar_id":"","url":"https://api.github.com/users/theobouwman","html_url":"https://github.com/theobouwman","followers_url":"https://api.github.com/users/theobouwman/followers","following_url":"https://api.github.com/users/theobouwman/following{/other_user}","gists_url":"https://api.github.com/users/theobouwman/gists{/gist_id}","starred_url":"https://api.github.com/users/theobouwman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theobouwman/subscriptions","organizations_url":"https://api.github.com/users/theobouwman/orgs","repos_url":"https://api.github.com/users/theobouwman/repos","events_url":"https://api.github.com/users/theobouwman/events{/privacy}","received_events_url":"https://api.github.com/users/theobouwman/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T17:35:39Z","updated_at":"2018-06-13T17:35:39Z","author_association":"NONE","body":"@NoNameProvided could you help?"}}
{"actor":{"display_login":"theobouwman"}}