Demonstrate that a client for EmptyAPI pattern-matches EmptyAPIClient
This commit is contained in:
parent
937a5c98fd
commit
e60bdadead
1 changed files with 6 additions and 1 deletions
|
@ -111,6 +111,8 @@ type Api =
|
||||||
Get '[JSON] (String, Maybe Int, Bool, [(String, [Rational])])
|
Get '[JSON] (String, Maybe Int, Bool, [(String, [Rational])])
|
||||||
:<|> "headers" :> Get '[JSON] (Headers TestHeaders Bool)
|
:<|> "headers" :> Get '[JSON] (Headers TestHeaders Bool)
|
||||||
:<|> "deleteContentType" :> DeleteNoContent '[JSON] NoContent
|
:<|> "deleteContentType" :> DeleteNoContent '[JSON] NoContent
|
||||||
|
:<|> "empty" :> EmptyAPI
|
||||||
|
|
||||||
api :: Proxy Api
|
api :: Proxy Api
|
||||||
api = Proxy
|
api = Proxy
|
||||||
|
|
||||||
|
@ -130,6 +132,7 @@ getMultiple :: String -> Maybe Int -> Bool -> [(String, [Rational])]
|
||||||
-> SCR.ClientM (String, Maybe Int, Bool, [(String, [Rational])])
|
-> SCR.ClientM (String, Maybe Int, Bool, [(String, [Rational])])
|
||||||
getRespHeaders :: SCR.ClientM (Headers TestHeaders Bool)
|
getRespHeaders :: SCR.ClientM (Headers TestHeaders Bool)
|
||||||
getDeleteContentType :: SCR.ClientM NoContent
|
getDeleteContentType :: SCR.ClientM NoContent
|
||||||
|
|
||||||
getGet
|
getGet
|
||||||
:<|> getDeleteEmpty
|
:<|> getDeleteEmpty
|
||||||
:<|> getCapture
|
:<|> getCapture
|
||||||
|
@ -142,7 +145,8 @@ getGet
|
||||||
:<|> getRawFailure
|
:<|> getRawFailure
|
||||||
:<|> getMultiple
|
:<|> getMultiple
|
||||||
:<|> getRespHeaders
|
:<|> getRespHeaders
|
||||||
:<|> getDeleteContentType = client api
|
:<|> getDeleteContentType
|
||||||
|
:<|> EmptyAPIClient = client api
|
||||||
|
|
||||||
server :: Application
|
server :: Application
|
||||||
server = serve api (
|
server = serve api (
|
||||||
|
@ -162,6 +166,7 @@ server = serve api (
|
||||||
:<|> (\ a b c d -> return (a, b, c, d))
|
:<|> (\ a b c d -> return (a, b, c, d))
|
||||||
:<|> (return $ addHeader 1729 $ addHeader "eg2" True)
|
:<|> (return $ addHeader 1729 $ addHeader "eg2" True)
|
||||||
:<|> return NoContent
|
:<|> return NoContent
|
||||||
|
:<|> emptyAPIServer
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue