2016-01-16 19:17:46 +01:00
|
|
|
{-# LANGUAGE DataKinds #-}
|
|
|
|
{-# LANGUAGE TypeOperators #-}
|
|
|
|
|
2016-01-18 19:55:14 +01:00
|
|
|
-- | This is a module containing an API with all `Servant.API` combinators. It
|
|
|
|
-- is used for testing only (in particular, checking that instances exist for
|
|
|
|
-- the core servant classes for each combinator), and should not be imported.
|
2016-01-16 19:17:46 +01:00
|
|
|
module Servant.API.Internal.Test.ComprehensiveAPI where
|
|
|
|
|
|
|
|
import Data.Proxy
|
|
|
|
|
|
|
|
import Servant.API
|
|
|
|
|
2016-07-08 09:11:34 +02:00
|
|
|
type GET = Get '[JSON] NoContent
|
2016-01-16 19:17:46 +01:00
|
|
|
|
|
|
|
type ComprehensiveAPI =
|
|
|
|
GET :<|>
|
|
|
|
Get '[JSON] Int :<|>
|
|
|
|
Capture "foo" Int :> GET :<|>
|
|
|
|
Header "foo" Int :> GET :<|>
|
2016-01-16 19:34:44 +01:00
|
|
|
HttpVersion :> GET :<|>
|
2016-01-16 19:17:46 +01:00
|
|
|
IsSecure :> GET :<|>
|
|
|
|
QueryParam "foo" Int :> GET :<|>
|
|
|
|
QueryParams "foo" Int :> GET :<|>
|
|
|
|
QueryFlag "foo" :> GET :<|>
|
|
|
|
-- Raw :<|>
|
2016-01-18 11:01:30 +01:00
|
|
|
RemoteHost :> GET :<|>
|
2016-01-16 19:17:46 +01:00
|
|
|
ReqBody '[JSON] Int :> GET :<|>
|
2016-07-08 09:11:34 +02:00
|
|
|
Get '[JSON] (Headers '[Header "foo" Int] NoContent) :<|>
|
2016-01-16 19:17:46 +01:00
|
|
|
"foo" :> GET :<|>
|
|
|
|
Vault :> GET :<|>
|
2016-07-08 09:11:34 +02:00
|
|
|
Verb 'POST 204 '[JSON] NoContent :<|>
|
2016-01-18 21:27:19 +01:00
|
|
|
Verb 'POST 204 '[JSON] Int :<|>
|
2016-07-04 14:38:00 +02:00
|
|
|
WithNamedContext "foo" '[] GET :<|>
|
|
|
|
CaptureAll "foo" Int :> GET
|
2016-01-16 19:17:46 +01:00
|
|
|
|
|
|
|
comprehensiveAPI :: Proxy ComprehensiveAPI
|
|
|
|
comprehensiveAPI = Proxy
|