diff --git a/src/Tie/Codegen/Operation.hs b/src/Tie/Codegen/Operation.hs index a4cb1f0..5212f39 100644 --- a/src/Tie/Codegen/Operation.hs +++ b/src/Tie/Codegen/Operation.hs @@ -331,12 +331,13 @@ codegenQueryParamGuard Param {name, required} continuation ) ) | otherwise = - "case" <+> "fmap" <+> "(" <> "fmap" <+> "(" <> "Web.HttpApiData.parseUrlPiece" <+> "." <+> "Data.Text.Encoding.decodeUtf8" <> ")" <> ")" <+> "(" + "case" <+> "Control.Monad.join" <+> "(" <> "fmap" <+> "(" <> "fmap" <+> "(" <> "Web.HttpApiData.parseUrlPiece" <+> "." <+> "Data.Text.Encoding.decodeUtf8" <> ")" <> ")" <+> "(" <> "Data.List.lookup" <+> "\"" <> toParamName name <> "\"" <+> "(" <> "Network.Wai.queryString" <+> "request" <> ")" + <> ")" <> ")" <+> "of" <> PP.line <> PP.indent diff --git a/test/golden/test1.yaml.out b/test/golden/test1.yaml.out index 938e624..33b8a2a 100644 --- a/test/golden/test1.yaml.out +++ b/test/golden/test1.yaml.out @@ -77,7 +77,7 @@ application run api notFound request respond = Just (Left err) -> undefined Just (Right page) -> - case fmap (fmap (Web.HttpApiData.parseUrlPiece . Data.Text.Encoding.decodeUtf8)) (Data.List.lookup "offset" (Network.Wai.queryString request)) of + case Control.Monad.join (fmap (fmap (Web.HttpApiData.parseUrlPiece . Data.Text.Encoding.decodeUtf8)) (Data.List.lookup "offset" (Network.Wai.queryString request))) of Just (Left err) -> undefined _x -> @@ -99,7 +99,7 @@ application run api notFound request respond = Just (Left err) -> undefined Just (Right page) -> - case fmap (fmap (Web.HttpApiData.parseUrlPiece . Data.Text.Encoding.decodeUtf8)) (Data.List.lookup "offset" (Network.Wai.queryString request)) of + case Control.Monad.join (fmap (fmap (Web.HttpApiData.parseUrlPiece . Data.Text.Encoding.decodeUtf8)) (Data.List.lookup "offset" (Network.Wai.queryString request))) of Just (Left err) -> undefined _x ->