From efcc04057d1c362e4eb89fe7e713f84a8a229cc6 Mon Sep 17 00:00:00 2001 From: piq9117 Date: Fri, 1 Mar 2024 11:27:14 -0500 Subject: [PATCH] update golden test --- test/golden/additional-properties.yaml.out | 10 +++++----- test/golden/bug-1.yaml.out | 10 +++++----- test/golden/bug-2.yaml.out | 10 +++++----- test/golden/csv.yaml.out | 10 +++++----- test/golden/datetime.yaml.out | 10 +++++----- test/golden/enum-bug.yaml.out | 10 +++++----- test/golden/enum.yaml.out | 10 +++++----- test/golden/haskell-ext.yaml.out | 10 +++++----- test/golden/headers.yaml.out | 10 +++++----- test/golden/lists.yaml.out | 10 +++++----- test/golden/numbers.yaml.out | 10 +++++----- test/golden/object-without-type.yaml.out | 10 +++++----- test/golden/oneof.yaml.out | 10 +++++----- test/golden/petstore.yaml.out | 10 +++++----- test/golden/test1.yaml.out | 10 +++++----- 15 files changed, 75 insertions(+), 75 deletions(-) diff --git a/test/golden/additional-properties.yaml.out b/test/golden/additional-properties.yaml.out index 846984e..cdf08f4 100644 --- a/test/golden/additional-properties.yaml.out +++ b/test/golden/additional-properties.yaml.out @@ -278,13 +278,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -304,11 +304,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/bug-1.yaml.out b/test/golden/bug-1.yaml.out index 9861381..e48fdcb 100644 --- a/test/golden/bug-1.yaml.out +++ b/test/golden/bug-1.yaml.out @@ -264,13 +264,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/bug-2.yaml.out b/test/golden/bug-2.yaml.out index 8746c50..ac77ad5 100644 --- a/test/golden/bug-2.yaml.out +++ b/test/golden/bug-2.yaml.out @@ -264,13 +264,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/csv.yaml.out b/test/golden/csv.yaml.out index 3383681..64ea806 100644 --- a/test/golden/csv.yaml.out +++ b/test/golden/csv.yaml.out @@ -278,13 +278,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -304,11 +304,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/datetime.yaml.out b/test/golden/datetime.yaml.out index fe1ba4f..f9c4ad9 100644 --- a/test/golden/datetime.yaml.out +++ b/test/golden/datetime.yaml.out @@ -264,13 +264,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/enum-bug.yaml.out b/test/golden/enum-bug.yaml.out index 113bc02..f1c32a2 100644 --- a/test/golden/enum-bug.yaml.out +++ b/test/golden/enum-bug.yaml.out @@ -267,13 +267,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -293,11 +293,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/enum.yaml.out b/test/golden/enum.yaml.out index c7a480c..45baa53 100644 --- a/test/golden/enum.yaml.out +++ b/test/golden/enum.yaml.out @@ -331,13 +331,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -357,11 +357,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/haskell-ext.yaml.out b/test/golden/haskell-ext.yaml.out index 20b0064..0b30cc7 100644 --- a/test/golden/haskell-ext.yaml.out +++ b/test/golden/haskell-ext.yaml.out @@ -282,13 +282,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -308,11 +308,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/headers.yaml.out b/test/golden/headers.yaml.out index 06fed75..189635a 100644 --- a/test/golden/headers.yaml.out +++ b/test/golden/headers.yaml.out @@ -295,13 +295,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -321,11 +321,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/lists.yaml.out b/test/golden/lists.yaml.out index f3ba781..5363c1c 100644 --- a/test/golden/lists.yaml.out +++ b/test/golden/lists.yaml.out @@ -328,13 +328,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -354,11 +354,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/numbers.yaml.out b/test/golden/numbers.yaml.out index 53ae705..7ff0d13 100644 --- a/test/golden/numbers.yaml.out +++ b/test/golden/numbers.yaml.out @@ -264,13 +264,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/object-without-type.yaml.out b/test/golden/object-without-type.yaml.out index d2ec9c6..a61a7bf 100644 --- a/test/golden/object-without-type.yaml.out +++ b/test/golden/object-without-type.yaml.out @@ -264,13 +264,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -290,11 +290,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/oneof.yaml.out b/test/golden/oneof.yaml.out index 1f2c586..6f5ecd9 100644 --- a/test/golden/oneof.yaml.out +++ b/test/golden/oneof.yaml.out @@ -294,13 +294,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -320,11 +320,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/petstore.yaml.out b/test/golden/petstore.yaml.out index 12713f1..80facee 100644 --- a/test/golden/petstore.yaml.out +++ b/test/golden/petstore.yaml.out @@ -295,13 +295,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -321,11 +321,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-} diff --git a/test/golden/test1.yaml.out b/test/golden/test1.yaml.out index d788c71..5f3e8e1 100644 --- a/test/golden/test1.yaml.out +++ b/test/golden/test1.yaml.out @@ -298,13 +298,13 @@ requiredQueryParameter :: requiredQueryParameter name withParam = \request respond -> case List.lookup name (Wai.queryString request) of Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just Nothing -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam x request respond {-# INLINEABLE requiredQueryParameter #-} @@ -324,11 +324,11 @@ optionalQueryParameter name allowEmpty withParam = \request respond -> | allowEmpty -> withParam Nothing request respond | otherwise -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Missing query parameter: " <> name)) Just (Just value) -> case parseQueryParam (Text.decodeUtf8 value) of Left _err -> - respond (Wai.responseBuilder (toEnum 400) [] mempty) + respond (Wai.responseBuilder (toEnum 400) [] ("Unable to recognize query parameter: " <> name)) Right x -> withParam (Just x) request respond {-# INLINEABLE optionalQueryParameter #-}