You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As in Servant, we need some delayed IO for work that shouldn't be done until a certain route has been selected. We do not want to read the request body, just because we traverse a ReqBody in the routing type, if the embedded handler does not match the request (and possibly cause 4xx errors and whatnot!). Instead, these things should build up and only be run when necessary.
@yanok Glad you like them. :) No, sorry, I've had no time to work on it. I did try at some point but it's a rather big and complex change. I doubt I'll have any time soon, so if you or someone else would like to pick this up that'd be great!
@owickstrom I'm a bit busy right now, but I hope to return to it at some point in the (hopefully near) future. But first I'd like to discuss the desired API a bit (sorry, I might ask really stupid questions, I was ignoring the whole Web thing completely until recently).
Does it make sense to be able to put ReqBody in different places in the path? If not, shouldn't we move ReqBody closer to the method selection?
At the moment, I'm using Raw when I need to read the request body. So those parts of the API contract are not represented in the type. It sounds like this feature would give handlers access to the request body without falling back to raw middleware? I'm not an advanced user of PureScript's type system but maybe I could help move this feature forward. Do you have a branch with your earlier work or could you say more about the approach you had in mind?
Activity
owickstrom commentedon Mar 27, 2017
I've started experimenting with this. Early stuff. :)
yanok commentedon Oct 18, 2017
Hi! Thanks for this awesome (family of) project! Any news about the
ReqBodyfeature?owickstrom commentedon Oct 20, 2017
@yanok Glad you like them. :) No, sorry, I've had no time to work on it. I did try at some point but it's a rather big and complex change. I doubt I'll have any time soon, so if you or someone else would like to pick this up that'd be great!
yanok commentedon Oct 24, 2017
@owickstrom I'm a bit busy right now, but I hope to return to it at some point in the (hopefully near) future. But first I'd like to discuss the desired API a bit (sorry, I might ask really stupid questions, I was ignoring the whole Web thing completely until recently).
ReqBodyin different places in the path? If not, shouldn't we moveReqBodycloser to the method selection?ReqBodys?maxhallinan commentedon Sep 11, 2019
At the moment, I'm using Raw when I need to read the request body. So those parts of the API contract are not represented in the type. It sounds like this feature would give handlers access to the request body without falling back to raw middleware? I'm not an advanced user of PureScript's type system but maybe I could help move this feature forward. Do you have a branch with your earlier work or could you say more about the approach you had in mind?
nsaunders commentedon Sep 11, 2019
@maxhallinan see my referenced PR for my first pass at the issue. I assume @owickstrom had something much more sophisticated in mind...
Add request body specification to `Method`