{"action":"opened","issue":{"url":"https://api.github.com/repos/pleerock/routing-controllers/issues/87","repository_url":"https://api.github.com/repos/pleerock/routing-controllers","labels_url":"https://api.github.com/repos/pleerock/routing-controllers/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/pleerock/routing-controllers/issues/87/comments","events_url":"https://api.github.com/repos/pleerock/routing-controllers/issues/87/events","html_url":"https://github.com/pleerock/routing-controllers/issues/87","id":209863910,"number":87,"title":"handle ValidationErrors","user":{"login":"timebuzzer-dbechtel","id":22303562,"avatar_url":"https://avatars.githubusercontent.com/u/22303562?v=3","gravatar_id":"","url":"https://api.github.com/users/timebuzzer-dbechtel","html_url":"https://github.com/timebuzzer-dbechtel","followers_url":"https://api.github.com/users/timebuzzer-dbechtel/followers","following_url":"https://api.github.com/users/timebuzzer-dbechtel/following{/other_user}","gists_url":"https://api.github.com/users/timebuzzer-dbechtel/gists{/gist_id}","starred_url":"https://api.github.com/users/timebuzzer-dbechtel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timebuzzer-dbechtel/subscriptions","organizations_url":"https://api.github.com/users/timebuzzer-dbechtel/orgs","repos_url":"https://api.github.com/users/timebuzzer-dbechtel/repos","events_url":"https://api.github.com/users/timebuzzer-dbechtel/events{/privacy}","received_events_url":"https://api.github.com/users/timebuzzer-dbechtel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-23T19:45:49Z","updated_at":"2017-02-23T19:45:49Z","closed_at":null,"body":"is there a way to handle ValidationErrors, which are throwed by the class-validator?\r\ni'm getting following response if i send invalid data:\r\n{\r\n\"name\": \"BadRequestError\",\r\n\"message\": \"Invalid body, check 'details' property for more info.\",\r\n\"stack\": \"Error\\n at BadRequestError.HttpError [as constructor] (\",\r\n\"httpCode\": 400,\r\n\"details\":[\r\n{\r\n\"target\":{…},\r\n\"value\": \"abc\",\r\n\"property\": \"email\",\r\n\"children\":[],\r\n\"constraints\":{\"isEmail\": \"email must be an email\"}\r\n}\r\n]\r\n}\r\n\r\nand i need the validation result in the following structure:\r\n{\r\n\"ValidationErrors\": [\r\n{\r\n\"target\":{…},\r\n\"value\": \"abc\",\r\n\"property\": \"email\",\r\n\"children\":[],\r\n\"constraints\":{\"isEmail\": \"email must be an email\"}\r\n}\r\n]\r\n}\r\n\r\nmaybe some kind of ValidationErrorMiddleware?"}}
{"actor":{"display_login":"timebuzzer-dbechtel"}}