@@ -12,7 +12,6 @@ import Servant.API ( type (:<|>), ReqBody, QueryParam, MatrixParam, MatrixParams
12 , MatrixFlag, Get, Post, Capture, type (:>) , HTML , JSON, XML )
12 , MatrixFlag, Get, Post, Capture, type (:>) , HTML , JSON, XML )
13import Servant.QQSpec ( (~>) )
13import Servant.QQSpec ( (~>) )
14import Servant.Utils.Links ( IsElem, IsLink )
14import Servant.Utils.Links ( IsElem, IsLink )
17type TestApi =
16type TestApi =
18 -- Capture and query/matrix params
17 -- Capture and query/matrix params
@@ -28,7 +27,7 @@ type TestApi =
28 -- All of the verbs
27 -- All of the verbs
29 :<|> "get" :> Get '[JSON] ()
28 :<|> "get" :> Get '[JSON] ()
30 :<|> "put" :> Put '[JSON] ()
29 :<|> "put" :> Put '[JSON] ()
31− :<|> "post" :> ReqBody 'True :> Post '[JSON] ()
30+ :<|> "post" :> ReqBody '[JSON] 'True :> Post '[JSON] ()
32 :<|> "delete" :> Header "ponies" :> Delete
31 :<|> "delete" :> Header "ponies" :> Delete
33 :<|> "raw" :> Raw
32 :<|> "raw" :> Raw
@@ -44,7 +43,7 @@ type BadTestLink' = "hello" :> "hi" :> Get '[HTML] Bool
44type BadTestLink'2 = "greet" :> Get '[HTML] Bool
43type BadTestLink'2 = "greet" :> Get '[HTML] Bool
46type NotALink = "hello" :> Capture "x" Bool :> Get '[JSON] Bool
45type NotALink = "hello" :> Capture "x" Bool :> Get '[JSON] Bool
47−type NotALink2 = "hello" :> ReqBody 'True :> Get '[JSON] Bool
46+type NotALink2 = "hello" :> ReqBody '[JSON] 'True :> Get '[JSON] Bool
49apiLink :: (IsElem endpoint TestApi, HasLink endpoint)
48apiLink :: (IsElem endpoint TestApi, HasLink endpoint)
50 => Proxy endpoint -> MkLink endpoint
49 => Proxy endpoint -> MkLink endpoint