{"action":"created","issue":{"url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/258","repository_url":"https://api.github.com/repos/bearsunday/BEAR.Package","labels_url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/258/comments","events_url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/258/events","html_url":"https://github.com/bearsunday/BEAR.Package/issues/258","id":303781283,"number":258,"title":"Content-Type が `application/json` の際にinvalidなjsonを送信するとTypeErrorとなる","user":{"login":"kalibora","id":434940,"avatar_url":"https://avatars3.githubusercontent.com/u/434940?v=4","gravatar_id":"","url":"https://api.github.com/users/kalibora","html_url":"https://github.com/kalibora","followers_url":"https://api.github.com/users/kalibora/followers","following_url":"https://api.github.com/users/kalibora/following{/other_user}","gists_url":"https://api.github.com/users/kalibora/gists{/gist_id}","starred_url":"https://api.github.com/users/kalibora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalibora/subscriptions","organizations_url":"https://api.github.com/users/kalibora/orgs","repos_url":"https://api.github.com/users/kalibora/repos","events_url":"https://api.github.com/users/kalibora/events{/privacy}","received_events_url":"https://api.github.com/users/kalibora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-09T09:45:56Z","updated_at":"2018-03-09T10:15:22Z","closed_at":null,"author_association":"NONE","body":"Content-Type が `application/json` の際に\r\nBodyを空にするなど invalid な json を送信すると TypeError となるようです。\r\n\r\nどのように振る舞うのがベターかはわからないのですが、\r\nHTTPのレスポンスコードとしては4xx系のコードを投げるのが良いかと思っています。\r\nその際に TypeError を Catch するのは乱暴なので、HttpMethodParams でエラーハンドリングして\r\nなにがしかの例外を投げるのが良いかなと思っていますが、いかがでしょうか。\r\n\r\n再現コードは下記に置きました。\r\nhttps://github.com/bearsunday/BEAR.Package/compare/1.x...kalibora:empty-json?expand=1\r\n"},"comment":{"url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/comments/371771667","html_url":"https://github.com/bearsunday/BEAR.Package/issues/258#issuecomment-371771667","issue_url":"https://api.github.com/repos/bearsunday/BEAR.Package/issues/258","id":371771667,"user":{"login":"koriym","id":529021,"avatar_url":"https://avatars1.githubusercontent.com/u/529021?v=4","gravatar_id":"","url":"https://api.github.com/users/koriym","html_url":"https://github.com/koriym","followers_url":"https://api.github.com/users/koriym/followers","following_url":"https://api.github.com/users/koriym/following{/other_user}","gists_url":"https://api.github.com/users/koriym/gists{/gist_id}","starred_url":"https://api.github.com/users/koriym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koriym/subscriptions","organizations_url":"https://api.github.com/users/koriym/orgs","repos_url":"https://api.github.com/users/koriym/repos","events_url":"https://api.github.com/users/koriym/events{/privacy}","received_events_url":"https://api.github.com/users/koriym/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T10:15:22Z","updated_at":"2018-03-09T10:15:22Z","author_association":"OWNER","body":"ありがとうございます！後で見ますね"}}
{"actor":{"display_login":"koriym"}}