{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/17716","labels_url":"https://api.github.com/repos/akka/akka/issues/17716/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/17716/comments","events_url":"https://api.github.com/repos/akka/akka/issues/17716/events","html_url":"https://github.com/akka/akka/issues/17716","id":88343478,"number":17716,"title":"Optional entity and empty body","user":{"login":"2m","id":422086,"avatar_url":"https://avatars.githubusercontent.com/u/422086?v=3","gravatar_id":"","url":"https://api.github.com/users/2m","html_url":"https://github.com/2m","followers_url":"https://api.github.com/users/2m/followers","following_url":"https://api.github.com/users/2m/following{/other_user}","gists_url":"https://api.github.com/users/2m/gists{/gist_id}","starred_url":"https://api.github.com/users/2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2m/subscriptions","organizations_url":"https://api.github.com/users/2m/orgs","repos_url":"https://api.github.com/users/2m/repos","events_url":"https://api.github.com/users/2m/events{/privacy}","received_events_url":"https://api.github.com/users/2m/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akka/akka/labels/1%20-%20triaged","name":"1 - triaged","color":"5319e7"},{"url":"https://api.github.com/repos/akka/akka/labels/t:http","name":"t:http","color":"ededed"},{"url":"https://api.github.com/repos/akka/akka/labels/t:http:server","name":"t:http:server","color":"ededed"},{"url":"https://api.github.com/repos/akka/akka/labels/t:http:server:dsl","name":"t:http:server:dsl","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/akka/akka/milestones/37","html_url":"https://github.com/akka/akka/milestones/http-1.0","labels_url":"https://api.github.com/repos/akka/akka/milestones/37/labels","id":1044204,"number":37,"title":"http-1.0","description":"","creator":{"login":"rkuhn","id":470469,"avatar_url":"https://avatars.githubusercontent.com/u/470469?v=3","gravatar_id":"","url":"https://api.github.com/users/rkuhn","html_url":"https://github.com/rkuhn","followers_url":"https://api.github.com/users/rkuhn/followers","following_url":"https://api.github.com/users/rkuhn/following{/other_user}","gists_url":"https://api.github.com/users/rkuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/rkuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkuhn/subscriptions","organizations_url":"https://api.github.com/users/rkuhn/orgs","repos_url":"https://api.github.com/users/rkuhn/repos","events_url":"https://api.github.com/users/rkuhn/events{/privacy}","received_events_url":"https://api.github.com/users/rkuhn/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":1,"state":"open","created_at":"2015-03-30T07:54:20Z","updated_at":"2015-06-18T15:58:39Z","due_on":"2015-05-28T22:00:00Z","closed_at":null},"comments":5,"created_at":"2015-06-15T07:17:55Z","updated_at":"2015-06-22T15:48:07Z","closed_at":null,"body":"As [reported in the mailing list](https://groups.google.com/forum/#!searchin/akka-user/optional$20entity/akka-user/gvP184RVHZQ/2QOfmMOHCAkJ) akka-http is not able to handle a request with an empty body when route expects an optional entity.\r\n\r\nEven an empty string is not a [valid json](https://www.ietf.org/rfc/rfc4627.txt) it should still be possible to handle such a request when expected entity is optional."},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/114159572","html_url":"https://github.com/akka/akka/issues/17716#issuecomment-114159572","issue_url":"https://api.github.com/repos/akka/akka/issues/17716","id":114159572,"user":{"login":"divijan","id":1155256,"avatar_url":"https://avatars.githubusercontent.com/u/1155256?v=3","gravatar_id":"","url":"https://api.github.com/users/divijan","html_url":"https://github.com/divijan","followers_url":"https://api.github.com/users/divijan/followers","following_url":"https://api.github.com/users/divijan/following{/other_user}","gists_url":"https://api.github.com/users/divijan/gists{/gist_id}","starred_url":"https://api.github.com/users/divijan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divijan/subscriptions","organizations_url":"https://api.github.com/users/divijan/orgs","repos_url":"https://api.github.com/users/divijan/repos","events_url":"https://api.github.com/users/divijan/events{/privacy}","received_events_url":"https://api.github.com/users/divijan/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T15:48:07Z","updated_at":"2015-06-22T15:48:07Z","body":"I was going to raise an issue that seems a sub-issue of this one. I define my own JsonSupport in the same vein as SprayJsonSupport is defined. I would like Entity Expected error message instead of \r\n\r\n    The request content was malformed:\r\n    ...\r\n\r\nwhen no body is provided. This also holds for non-optional entity routes. Can this be made a default behavior on the lowest level Unmarshallers, like byteStringUnmarshaller? Judging from MarshallingDirectivesTest in akka-http-tests, the user is expected to handle empty entities by hand, which, to my mind, should be handled automatically"}}