{"action":"created","issue":{"url":"https://api.github.com/repos/lagom/lagom/issues/1475","repository_url":"https://api.github.com/repos/lagom/lagom","labels_url":"https://api.github.com/repos/lagom/lagom/issues/1475/labels{/name}","comments_url":"https://api.github.com/repos/lagom/lagom/issues/1475/comments","events_url":"https://api.github.com/repos/lagom/lagom/issues/1475/events","html_url":"https://github.com/lagom/lagom/pull/1475","id":343380927,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDQyMDE5","number":1475,"title":"handle no body as a valid input","user":{"login":"idoshamun","id":1993245,"node_id":"MDQ6VXNlcjE5OTMyNDU=","avatar_url":"https://avatars2.githubusercontent.com/u/1993245?v=4","gravatar_id":"","url":"https://api.github.com/users/idoshamun","html_url":"https://github.com/idoshamun","followers_url":"https://api.github.com/users/idoshamun/followers","following_url":"https://api.github.com/users/idoshamun/following{/other_user}","gists_url":"https://api.github.com/users/idoshamun/gists{/gist_id}","starred_url":"https://api.github.com/users/idoshamun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idoshamun/subscriptions","organizations_url":"https://api.github.com/users/idoshamun/orgs","repos_url":"https://api.github.com/users/idoshamun/repos","events_url":"https://api.github.com/users/idoshamun/events{/privacy}","received_events_url":"https://api.github.com/users/idoshamun/received_events","type":"User","site_admin":false},"labels":[{"id":660037261,"node_id":"MDU6TGFiZWw2NjAwMzcyNjE=","url":"https://api.github.com/repos/lagom/lagom/labels/topic:service-api","name":"topic:service-api","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"ignasi35","id":762126,"node_id":"MDQ6VXNlcjc2MjEyNg==","avatar_url":"https://avatars2.githubusercontent.com/u/762126?v=4","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false},"assignees":[{"login":"ignasi35","id":762126,"node_id":"MDQ6VXNlcjc2MjEyNg==","avatar_url":"https://avatars2.githubusercontent.com/u/762126?v=4","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2018-07-22T06:18:14Z","updated_at":"2018-07-25T12:07:21Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/lagom/lagom/pulls/1475","html_url":"https://github.com/lagom/lagom/pull/1475","diff_url":"https://github.com/lagom/lagom/pull/1475.diff","patch_url":"https://github.com/lagom/lagom/pull/1475.patch"},"body":"## Purpose\r\n\r\nAllow sending requests with no body without throwing an exception.\r\nSome services might define their input as `Option` but currently you must send body\r\nwith your request if the service has an input even if the body is `{}`.\r\n\r\nMy fix checks if the input byte stream is empty and if so it returns an empty `JsObject` instead of throwing \r\n`DeserializationException`.\r\n\r\n## Notes\r\n\r\nPlease let me know if tests are necessary because I could not find tests for `MessageSerializer`."},"comment":{"url":"https://api.github.com/repos/lagom/lagom/issues/comments/407731916","html_url":"https://github.com/lagom/lagom/pull/1475#issuecomment-407731916","issue_url":"https://api.github.com/repos/lagom/lagom/issues/1475","id":407731916,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzczMTkxNg==","user":{"login":"ignasi35","id":762126,"node_id":"MDQ6VXNlcjc2MjEyNg==","avatar_url":"https://avatars2.githubusercontent.com/u/762126?v=4","gravatar_id":"","url":"https://api.github.com/users/ignasi35","html_url":"https://github.com/ignasi35","followers_url":"https://api.github.com/users/ignasi35/followers","following_url":"https://api.github.com/users/ignasi35/following{/other_user}","gists_url":"https://api.github.com/users/ignasi35/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasi35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasi35/subscriptions","organizations_url":"https://api.github.com/users/ignasi35/orgs","repos_url":"https://api.github.com/users/ignasi35/repos","events_url":"https://api.github.com/users/ignasi35/events{/privacy}","received_events_url":"https://api.github.com/users/ignasi35/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T12:07:21Z","updated_at":"2018-07-25T12:07:21Z","author_association":"MEMBER","body":"> But I think the main difference is that we look differently at Lagom, you see it as an RPC framework and I see it as a microservice framework that should integrate nicely with my other systems.\r\n\r\nInterop is important for Lagom as it is for any other stack that participates on a micro-services system. We're adding support for gRPC for that reason.\r\n\r\nI think supporting _Option[T] request payloads_ is the way forward. I actually maps quite well with [OpenAPI's `required` field](https://swagger.io/docs/specification/describing-request-body/) to describe request bodies (defaults to `false`).\r\n\r\nThen the solution would be:\r\n\r\n * work to support `ServiceCall[Option[T], Response]` where empty body is possible and is translated to `None`.\r\n * `ServiceCall[T, Response]` is equivalent to OpenAPI's `required: true` and it should fail when receiving an empty body.\r\n\r\n\r\n"}}
{"actor":{"display_login":"ignasi35"}}