Directive: Optional entity and empty body
- Dominant language
- Scala
- Stars
- 1.4k
- Forks
- 584
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 24
Description
**Issue by [2m](https://github.com/2m)**
_Monday Jun 15, 2015 at 07:17 GMT_
_Originally opened as https://github.com/akka/akka/issues/17716_
---
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.
Even 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.
Contributor guide
Research direction
Start with akka-http's directive handling for routes that expect an optional entity, using the linked mailing-list report and the empty-body request scenario as context. Reproduce a request with an empty body, including an empty string for the JSON entity, and verify that the optional-entity route accepts it without treating the body as invalid JSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100