From 75da485e0ff5a60051a39602d90f5f5c442945d2 Mon Sep 17 00:00:00 2001 From: Erik Aker Date: Sat, 18 Jan 2020 22:04:24 -0800 Subject: [PATCH] Re-export Web.FormUrlEncoded from Servant.API --- servant-client-core/servant-client-core.cabal | 1 - servant-client-core/src/Servant/Client/Core/HasClient.hs | 4 +--- servant-client-core/src/Servant/Client/Core/Request.hs | 5 ++--- servant-docs/servant-docs.cabal | 2 -- servant-docs/src/Servant/Docs/Internal.hs | 2 -- servant-docs/test/Servant/DocsSpec.hs | 3 --- servant/src/Servant/API.hs | 5 +++++ 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index f7dcf4a8..3faf65bb 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -79,7 +79,6 @@ library , base64-bytestring >= 1.0.0.1 && < 1.1 , exceptions >= 0.10.0 && < 0.11 , free >= 5.1 && < 5.2 - , http-api-data >= 0.4 && < 0.4.2 , http-media >= 0.7.1.3 && < 0.9 , http-types >= 0.12.2 && < 0.13 , network-uri >= 2.6.1.0 && < 2.7 diff --git a/servant-client-core/src/Servant/Client/Core/HasClient.hs b/servant-client-core/src/Servant/Client/Core/HasClient.hs index 7f9bc5f9..e26c1cdc 100644 --- a/servant-client-core/src/Servant/Client/Core/HasClient.hs +++ b/servant-client-core/src/Servant/Client/Core/HasClient.hs @@ -49,7 +49,7 @@ import Servant.API IsSecure, MimeRender (mimeRender), MimeUnrender (mimeUnrender), NoContent (NoContent), QueryFlag, QueryParam', QueryParams, QueryParamForm', Raw, ReflectMethod (..), RemoteHost, - ReqBody', SBoolI, Stream, StreamBody', Summary, ToHttpApiData, + ReqBody', SBoolI, Stream, StreamBody', Summary, ToHttpApiData, ToForm (..), ToSourceIO (..), Vault, Verb, NoContentVerb, WithNamedContext, contentType, getHeadersHList, getResponse, toQueryParam, toUrlPiece) @@ -57,8 +57,6 @@ import Servant.API.ContentTypes (contentTypes) import Servant.API.Modifiers (FoldRequired, RequiredArgument, foldRequiredArgument) -import Web.FormUrlEncoded - (ToForm (..)) import Servant.Client.Core.Auth import Servant.Client.Core.BasicAuth diff --git a/servant-client-core/src/Servant/Client/Core/Request.hs b/servant-client-core/src/Servant/Client/Core/Request.hs index 16568b80..ca5f855c 100644 --- a/servant-client-core/src/Servant/Client/Core/Request.hs +++ b/servant-client-core/src/Servant/Client/Core/Request.hs @@ -53,9 +53,8 @@ import Network.HTTP.Types (Header, HeaderName, HttpVersion (..), Method, QueryItem, http11, methodGet) import Servant.API - (ToHttpApiData, toEncodedUrlPiece, toHeader, SourceIO) -import Web.FormUrlEncoded - (ToForm (..), toListStable) + (ToHttpApiData, toEncodedUrlPiece, toHeader, SourceIO, + ToForm (..), toListStable) import Servant.Client.Core.Internal (mediaTypeRnf) diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index 8799b5d2..72896d72 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -62,7 +62,6 @@ library , base-compat >= 0.10.5 && < 0.12 , case-insensitive >= 1.2.0.11 && < 1.3 , hashable >= 1.2.7.0 && < 1.4 - , http-api-data >= 0.4 && < 0.4.2 , http-media >= 0.7.1.3 && < 0.9 , http-types >= 0.12.2 && < 0.13 , lens >= 4.17 && < 4.19 @@ -101,7 +100,6 @@ test-suite spec base , base-compat , aeson - , http-api-data , lens , servant , servant-docs diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index bd4360c3..c2cca1ca 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -64,8 +64,6 @@ import GHC.TypeLits import Servant.API import Servant.API.ContentTypes import Servant.API.TypeLevel -import Web.FormUrlEncoded - (ToForm(..), urlEncodeAsForm) import qualified Data.Universe.Helpers as U diff --git a/servant-docs/test/Servant/DocsSpec.hs b/servant-docs/test/Servant/DocsSpec.hs index 5c98ec32..d53f53dc 100644 --- a/servant-docs/test/Servant/DocsSpec.hs +++ b/servant-docs/test/Servant/DocsSpec.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} @@ -36,8 +35,6 @@ import Test.Tasty.Golden (goldenVsString) import Test.Tasty.HUnit (Assertion, HasCallStack, assertFailure, testCase, (@?=)) -import Web.FormUrlEncoded - (ToForm) import Servant.API import Servant.Docs.Internal diff --git a/servant/src/Servant/API.hs b/servant/src/Servant/API.hs index d5dfbb34..dcb0efac 100644 --- a/servant/src/Servant/API.hs +++ b/servant/src/Servant/API.hs @@ -58,6 +58,9 @@ module Servant.API ( module Web.HttpApiData, -- | Classes and instances for types that can be converted to and from HTTP API data. + -- * ToForm and FromForm + module Web.FormUrlEncoded, + -- | Classes and instances for working with Forms -- * Experimental modules module Servant.API.Experimental.Auth, @@ -139,3 +142,5 @@ import Servant.Links (HasLink (..), IsElem, IsElem', Link, URI (..), safeLink) import Web.HttpApiData (FromHttpApiData (..), ToHttpApiData (..)) +import Web.FormUrlEncoded + (ToForm (..), urlEncodeAsForm, toListStable) \ No newline at end of file