Closed
Description
Consider the routing table:
type Routes =
...
:<|> ReqBody User :> Post UserID
:<|> Capture "userid" UserID :> ReqBody User :> Put ()
...
The first route fails for Put requests, but the second will find that
the request body has already been parsed, and will complain about ""
not being a parseable json representation of User
.
The work-around is simple:
type Routes =
...
:<|> Capture "userid" UserID :> ReqBody User :> Put ()
:<|> ReqBody User :> Post UserID
...
But I'm not sure it is that simple in all cases, or that obvious to
understand the situation once you've stumbled into this trap.
We have some (limited) resources to work on a solution, but we would
like to hear what you think first.
Servant is AWwesome, btw. Thanks for writing it! (:
Metadata
Metadata
Assignees
Labels
No labels