{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/464","repository_url":"https://api.github.com/repos/haskell-servant/servant","labels_url":"https://api.github.com/repos/haskell-servant/servant/issues/464/labels{/name}","comments_url":"https://api.github.com/repos/haskell-servant/servant/issues/464/comments","events_url":"https://api.github.com/repos/haskell-servant/servant/issues/464/events","html_url":"https://github.com/haskell-servant/servant/issues/464","id":147938441,"number":464,"title":"Multiple optional QueryParam -- one of them is always Nothing.","user":{"login":"jjmornim","id":18319220,"avatar_url":"https://avatars.githubusercontent.com/u/18319220?v=3","gravatar_id":"","url":"https://api.github.com/users/jjmornim","html_url":"https://github.com/jjmornim","followers_url":"https://api.github.com/users/jjmornim/followers","following_url":"https://api.github.com/users/jjmornim/following{/other_user}","gists_url":"https://api.github.com/users/jjmornim/gists{/gist_id}","starred_url":"https://api.github.com/users/jjmornim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjmornim/subscriptions","organizations_url":"https://api.github.com/users/jjmornim/orgs","repos_url":"https://api.github.com/users/jjmornim/repos","events_url":"https://api.github.com/users/jjmornim/events{/privacy}","received_events_url":"https://api.github.com/users/jjmornim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-13T03:44:01Z","updated_at":"2016-04-13T06:40:07Z","closed_at":null,"body":"In my servant app I have this:\r\n```\r\n    \"items\" :> QueryParam \"aaa\" Int :> QueryParam \"bbb\" Int :> Get '[JSON] [MyData] :<|> ....\r\n\r\n    getItems :: Maybe Int -> Maybe Int -> ExceptT ServantErr IO [MyData]\r\n    getItems aaa bbb = do ...\r\n      --..............\r\n      print $ (show aaa)\r\n      print $ (show bbb)\r\n```\r\nWhen I pass one  param to it, it prints `Just xxx` and that's what I need. But when I pass 2 params \"aaa\" and \"bbb\", the 2nd one is always `Nothing`, whereas the 1st one is `Just xxx`. \r\n\r\nWhy? I want they both to be optional and the order in which I pass them shouldn't matter.\r\n\r\nIf you need a minimal working example I'll try to create it, but maybe you've already noticed a mistake and why it's not working? \r\n"},"comment":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/comments/209255552","html_url":"https://github.com/haskell-servant/servant/issues/464#issuecomment-209255552","issue_url":"https://api.github.com/repos/haskell-servant/servant/issues/464","id":209255552,"user":{"login":"jjmornim","id":18319220,"avatar_url":"https://avatars.githubusercontent.com/u/18319220?v=3","gravatar_id":"","url":"https://api.github.com/users/jjmornim","html_url":"https://github.com/jjmornim","followers_url":"https://api.github.com/users/jjmornim/followers","following_url":"https://api.github.com/users/jjmornim/following{/other_user}","gists_url":"https://api.github.com/users/jjmornim/gists{/gist_id}","starred_url":"https://api.github.com/users/jjmornim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjmornim/subscriptions","organizations_url":"https://api.github.com/users/jjmornim/orgs","repos_url":"https://api.github.com/users/jjmornim/repos","events_url":"https://api.github.com/users/jjmornim/events{/privacy}","received_events_url":"https://api.github.com/users/jjmornim/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T06:40:07Z","updated_at":"2016-04-13T06:40:07Z","body":"Oh my God, an url has to be wrapped into ' or \" otherwise \"&\" is treated by Linux like \"do work in background\". Thanks."}}