{"action":"created","issue":{"url":"https://api.github.com/repos/philopon/apiary/issues/17","labels_url":"https://api.github.com/repos/philopon/apiary/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/philopon/apiary/issues/17/comments","events_url":"https://api.github.com/repos/philopon/apiary/issues/17/events","html_url":"https://github.com/philopon/apiary/issues/17","id":103420860,"number":17,"title":"Fail to parse request body when there're query params guard","user":{"login":"winterland1989","id":1295998,"avatar_url":"https://avatars.githubusercontent.com/u/1295998?v=3","gravatar_id":"","url":"https://api.github.com/users/winterland1989","html_url":"https://github.com/winterland1989","followers_url":"https://api.github.com/users/winterland1989/followers","following_url":"https://api.github.com/users/winterland1989/following{/other_user}","gists_url":"https://api.github.com/users/winterland1989/gists{/gist_id}","starred_url":"https://api.github.com/users/winterland1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winterland1989/subscriptions","organizations_url":"https://api.github.com/users/winterland1989/orgs","repos_url":"https://api.github.com/users/winterland1989/repos","events_url":"https://api.github.com/users/winterland1989/events{/privacy}","received_events_url":"https://api.github.com/users/winterland1989/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/philopon/apiary/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-27T03:39:54Z","updated_at":"2015-08-28T07:07:02Z","closed_at":null,"body":"After some digging i final found how to reproduce this problem:\r\nif you use `getReqBodyParams` inside a router with query params guard like this:\r\n```.hs\r\ncommentRouter = do\r\n    [capture|/comment|] $ do\r\n        method POST . ([key|whatever|] =: pText) . action $ do\r\n            params <- getReqBodyParams\r\n            liftIO $ print params\r\n```\r\nyou won't get any body params, a more interesting situation is like this:\r\n```.hs\r\ncommentRouter ::  Monad m => ApiaryT '[Session T.Text IO, Persist, Logger] '[] IO m ()\r\ncommentRouter = do\r\n    [capture|/comment|] $ do\r\n        method POST . action $ do\r\n            params <- getReqBodyParams\r\n            liftIO $ print params\r\n\r\n        method GET . ([key|sid|] =: pInt64) .\r\n            ([key|page|] =: pInt) .\r\n            ([key|perPage|] =: pInt) .\r\n            action $ do\r\n            (sid, page, perPage) <- [params|sid, page, perPage|]\r\n            cmts <- runSql $ selectList [CommentSnippet ==. toSqlKey sid]\r\n                [Asc CommentMtime, LimitTo perPage, OffsetBy $ (page - 1) * perPage]\r\n            jsonRes cmts\r\n  where\r\n    pInt64 :: Proxy Int64\r\n    pInt64 = Proxy\r\n```\r\nThat's the code from my project, if i have a guarded router(the GET one above) inside the parent router, any other router(here is the POST one) can't get any params using `getReqBodyParams`.\r\nI also tried `getRequest` and use `Network.Wai.Parse` to parse myself, but still can't get request body back, but if i remove the whole GET router, the POST router works as expected.\r\n\r\nIs this a issue or just a usage problem?"},"comment":{"url":"https://api.github.com/repos/philopon/apiary/issues/comments/135657716","html_url":"https://github.com/philopon/apiary/issues/17#issuecomment-135657716","issue_url":"https://api.github.com/repos/philopon/apiary/issues/17","id":135657716,"user":{"login":"winterland1989","id":1295998,"avatar_url":"https://avatars.githubusercontent.com/u/1295998?v=3","gravatar_id":"","url":"https://api.github.com/users/winterland1989","html_url":"https://github.com/winterland1989","followers_url":"https://api.github.com/users/winterland1989/followers","following_url":"https://api.github.com/users/winterland1989/following{/other_user}","gists_url":"https://api.github.com/users/winterland1989/gists{/gist_id}","starred_url":"https://api.github.com/users/winterland1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winterland1989/subscriptions","organizations_url":"https://api.github.com/users/winterland1989/orgs","repos_url":"https://api.github.com/users/winterland1989/repos","events_url":"https://api.github.com/users/winterland1989/events{/privacy}","received_events_url":"https://api.github.com/users/winterland1989/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T07:07:02Z","updated_at":"2015-08-28T07:07:02Z","body":"ok,  testing right now."}}