From a9afd37afe1cee3bdd5dc485f8d47423435a2e44 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Wed, 31 Aug 2016 13:32:12 +0300 Subject: [PATCH] Support http-api-data-0.3 --- servant-client/servant-client.cabal | 2 +- servant-server/servant-server.cabal | 2 +- servant-server/src/Servant/Server/Internal.hs | 7 +++++++ servant/servant.cabal | 2 +- stack.yaml | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index 089e1209..83ae56f2 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -41,7 +41,7 @@ library , base64-bytestring >= 1.0.0.1 && < 1.1 , bytestring >= 0.10 && < 0.11 , exceptions >= 0.8 && < 0.9 - , http-api-data >= 0.1 && < 0.3 + , http-api-data >= 0.1 && < 0.4 , http-client >= 0.4.18.1 && < 0.6 , http-client-tls >= 0.2.2 && < 0.4 , http-media >= 0.6.2 && < 0.7 diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index d055df2f..cf01cbd3 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -52,7 +52,7 @@ library , base64-bytestring >= 1.0 && < 1.1 , bytestring >= 0.10 && < 0.11 , containers >= 0.5 && < 0.6 - , http-api-data >= 0.1 && < 0.3 + , http-api-data >= 0.1 && < 0.4 , http-types >= 0.8 && < 0.10 , network-uri >= 2.6 && < 2.7 , mtl >= 2 && < 2.3 diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index de4a237a..2c94ef1c 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -43,10 +43,17 @@ import Network.Wai (Application, Request, Response, import Prelude () import Prelude.Compat import Web.HttpApiData (FromHttpApiData) +#if MIN_VERSION_http_api_data(0,3,0) +import Web.Internal.HttpApiData (parseHeaderMaybe, + parseQueryParamMaybe, + parseUrlPieceMaybe, + parseUrlPieces) +#else import Web.HttpApiData.Internal (parseHeaderMaybe, parseQueryParamMaybe, parseUrlPieceMaybe, parseUrlPieces) +#endif import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture, CaptureAll, Verb, diff --git a/servant/servant.cabal b/servant/servant.cabal index 3c89171f..2c5b679e 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -56,7 +56,7 @@ library , bytestring >= 0.10 && < 0.11 , bytestring-conversion >= 0.3 && < 0.4 , case-insensitive >= 1.2 && < 1.3 - , http-api-data >= 0.1 && < 0.3 + , http-api-data >= 0.1 && < 0.4 , http-media >= 0.4 && < 0.7 , http-types >= 0.8 && < 0.10 , mtl >= 2.0 && < 2.3 diff --git a/stack.yaml b/stack.yaml index 95599455..7dbe3a15 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,4 +9,5 @@ packages: - servant-server/ - doc/tutorial extra-deps: +- http-api-data-0.3 resolver: lts-6.0