git.iko.soy/typeable/servant
on master help sign in
add HasClient instance for HttpVersion
b20b8d9Sönke Hahn
servant-client/src/Servant/Client.hs+11
@@ -203,6 +203,17 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient sublayout)
203
203
204 where hname = symbolVal (Proxy :: Proxy sym)
204 where hname = symbolVal (Proxy :: Proxy sym)
205
205
206+-- | Using a 'HttpVersion' combinator in your API doesn't affect the client
207+-- functions.
208+instance HasClient sublayout
209+ => HasClient (HttpVersion :> sublayout) where
210+
211+ type Client (HttpVersion :> sublayout) =
212+ Client sublayout
213+
214+ clientWithRoute Proxy =
215+ clientWithRoute (Proxy :: Proxy sublayout)
216+
206-- | If you use a 'QueryParam' in one of your endpoints in your API,
217-- | If you use a 'QueryParam' in one of your endpoints in your API,
207-- the corresponding querying function will automatically take
218-- the corresponding querying function will automatically take
208-- an additional argument of the type specified by your 'QueryParam',
219-- an additional argument of the type specified by your 'QueryParam',
servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs+1−1
@@ -14,7 +14,7 @@ type ComprehensiveAPI =
14 Get '[JSON] Int :<|>
14 Get '[JSON] Int :<|>
15 Capture "foo" Int :> GET :<|>
15 Capture "foo" Int :> GET :<|>
16 Header "foo" Int :> GET :<|>
16 Header "foo" Int :> GET :<|>
17−-- HttpVersion :> GET :<|>
17+ HttpVersion :> GET :<|>
18 IsSecure :> GET :<|>
18 IsSecure :> GET :<|>
19 QueryParam "foo" Int :> GET :<|>
19 QueryParam "foo" Int :> GET :<|>
20 QueryParams "foo" Int :> GET :<|>
20 QueryParams "foo" Int :> GET :<|>