{"action":"created","issue":{"url":"https://api.github.com/repos/fastify/fastify/issues/860","repository_url":"https://api.github.com/repos/fastify/fastify","labels_url":"https://api.github.com/repos/fastify/fastify/issues/860/labels{/name}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/860/comments","events_url":"https://api.github.com/repos/fastify/fastify/issues/860/events","html_url":"https://github.com/fastify/fastify/pull/860","id":308095780,"number":860,"title":"better error messages for json schema errors","user":{"login":"StarpTech","id":1764424,"avatar_url":"https://avatars2.githubusercontent.com/u/1764424?v=4","gravatar_id":"","url":"https://api.github.com/users/StarpTech","html_url":"https://github.com/StarpTech","followers_url":"https://api.github.com/users/StarpTech/followers","following_url":"https://api.github.com/users/StarpTech/following{/other_user}","gists_url":"https://api.github.com/users/StarpTech/gists{/gist_id}","starred_url":"https://api.github.com/users/StarpTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarpTech/subscriptions","organizations_url":"https://api.github.com/users/StarpTech/orgs","repos_url":"https://api.github.com/users/StarpTech/repos","events_url":"https://api.github.com/users/StarpTech/events{/privacy}","received_events_url":"https://api.github.com/users/StarpTech/received_events","type":"User","site_admin":false},"labels":[{"id":451588688,"url":"https://api.github.com/repos/fastify/fastify/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":764678316,"url":"https://api.github.com/repos/fastify/fastify/labels/semver-minor","name":"semver-minor","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-23T16:24:14Z","updated_at":"2018-03-23T18:39:19Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/fastify/fastify/pulls/860","html_url":"https://github.com/fastify/fastify/pull/860","diff_url":"https://github.com/fastify/fastify/pull/860.diff","patch_url":"https://github.com/fastify/fastify/pull/860.patch"},"body":"This PR will improve the expressiveness of JSON Schema errors.\r\n\r\nBefore:\r\n```json\r\n{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"[{\\\"keyword\\\":\\\"type\\\",\\\"dataPath\\\":\\\".age\\\",\\\"schemaPath\\\":\\\"#/properties/age/type\\\",\\\"params\\\":{\\\"type\\\":\\\"number\\\"},\\\"message\\\":\\\"should be number\\\"}]\"}\r\n```\r\nAfter:\r\n```json\r\n{\"statusCode\":400,\"error\":\"Bad Request\",\"message\":\"querystring.age should be number\"}\r\n```\r\n\r\n**Benefits:**\r\n\r\n- Expressive error messages\r\n- Point to the correct data source location\r\n- No serilization needed\r\n- Error message is readable\r\n\r\n#### Checklist\r\n\r\n- [X] run `npm run test` and `npm run benchmark`\r\n- [X] tests and/or benchmarks are included\r\n- [ ] documentation is changed or added\r\n- [X] commit message and code follows [Code of conduct](https://github.com/fastify/fastify/blob/master/CODE_OF_CONDUCT.md)\r\n"},"comment":{"url":"https://api.github.com/repos/fastify/fastify/issues/comments/375762391","html_url":"https://github.com/fastify/fastify/pull/860#issuecomment-375762391","issue_url":"https://api.github.com/repos/fastify/fastify/issues/860","id":375762391,"user":{"login":"StarpTech","id":1764424,"avatar_url":"https://avatars2.githubusercontent.com/u/1764424?v=4","gravatar_id":"","url":"https://api.github.com/users/StarpTech","html_url":"https://github.com/StarpTech","followers_url":"https://api.github.com/users/StarpTech/followers","following_url":"https://api.github.com/users/StarpTech/following{/other_user}","gists_url":"https://api.github.com/users/StarpTech/gists{/gist_id}","starred_url":"https://api.github.com/users/StarpTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarpTech/subscriptions","organizations_url":"https://api.github.com/users/StarpTech/orgs","repos_url":"https://api.github.com/users/StarpTech/repos","events_url":"https://api.github.com/users/StarpTech/events{/privacy}","received_events_url":"https://api.github.com/users/StarpTech/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T18:39:19Z","updated_at":"2018-03-23T18:39:19Z","author_association":"MEMBER","body":"Branch:\r\n```\r\n[1] Running 5s test @ http://localhost:3000/\r\n[1] 100 connections with 10 pipelining factor\r\n[1]\r\n[0] server listening on 3000\r\n[1] Stat         Avg     Stdev    Max\r\n[1] Latency (ms) 2.23    14.79    751.77\r\n[1] Req/Sec      43596   17670.55 53326\r\n[1] Bytes/Sec    6.48 MB 2.64 MB  7.95 MB\r\n[1]\r\n[1] 218k requests in 5s, 32.5 MB read\r\n```\r\nMaster\r\n```\r\n[1] Running 5s test @ http://localhost:3000/\r\n[1] 100 connections with 10 pipelining factor\r\n[1]\r\n[0] server listening on 3000\r\n[1] Stat         Avg     Stdev    Max\r\n[1] Latency (ms) 2.28    15.39    845.72\r\n[1] Req/Sec      42693.2 17668.23 52827\r\n[1] Bytes/Sec    6.4 MB  2.67 MB  7.87 MB\r\n[1]\r\n[1] 213k requests in 5s, 31.8 MB read\r\n```"}}
{"actor":{"display_login":"StarpTech"}}