git.iko.soy/typeable/servant
on master help sign in
add HasClient instance for HttpVersion
commitb20b8d977046bfa3dad669dbf623488a5b4f6024 authorSönke Hahn <soenkehahn@gmail.com> dateSat 16 Jan 2016, 19:34 (11 years ago) parente5974ec
2 files changed+12−1
servant-client/src/Servant/Client.hs+11 servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs+1−1
servant-client/src/Servant/Client.hs+11
@@ -203,6 +203,17 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient sublayout)
203203
204204 where hname = symbolVal (Proxy :: Proxy sym)
205205
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+
206217-- | If you use a 'QueryParam' in one of your endpoints in your API,
207218-- the corresponding querying function will automatically take
208219-- 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 =
1414 Get '[JSON] Int :<|>
1515 Capture "foo" Int :> GET :<|>
1616 Header "foo" Int :> GET :<|>
17−-- HttpVersion :> GET :<|>
17+ HttpVersion :> GET :<|>
1818 IsSecure :> GET :<|>
1919 QueryParam "foo" Int :> GET :<|>
2020 QueryParams "foo" Int :> GET :<|>