add Raw to ComprehensiveAPI (and add ComprehensiveAPIWithoutRaw)

This commit is contained in:
Sönke Hahn 2016-08-17 15:51:10 +02:00
parent f5efaf9416
commit 23493d982d
2 changed files with 10 additions and 4 deletions

View File

@ -33,7 +33,7 @@ import Servant.JSSpec.CustomHeaders
-- * comprehensive api
-- This declaration simply checks that all instances are in place.
_ = jsForAPI comprehensiveAPI vanillaJS :: Text
_ = jsForAPI comprehensiveAPIWithoutRaw vanillaJS :: Text
-- * specs

View File

@ -13,6 +13,13 @@ import Servant.API
type GET = Get '[JSON] NoContent
type ComprehensiveAPI =
ComprehensiveAPIWithoutRaw :<|>
Raw
comprehensiveAPI :: Proxy ComprehensiveAPI
comprehensiveAPI = Proxy
type ComprehensiveAPIWithoutRaw =
GET :<|>
Get '[JSON] Int :<|>
Capture "foo" Int :> GET :<|>
@ -22,7 +29,6 @@ type ComprehensiveAPI =
QueryParam "foo" Int :> GET :<|>
QueryParams "foo" Int :> GET :<|>
QueryFlag "foo" :> GET :<|>
-- Raw :<|>
RemoteHost :> GET :<|>
ReqBody '[JSON] Int :> GET :<|>
Get '[JSON] (Headers '[Header "foo" Int] NoContent) :<|>
@ -33,5 +39,5 @@ type ComprehensiveAPI =
WithNamedContext "foo" '[] GET :<|>
CaptureAll "foo" Int :> GET
comprehensiveAPI :: Proxy ComprehensiveAPI
comprehensiveAPI = Proxy
comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPIWithoutRaw
comprehensiveAPIWithoutRaw = Proxy