@@ -25,6 +25,7 @@ type TestApi =
2525 :<|> "post" :> ReqBody '[JSON] 'True :> Post '[JSON] NoContent
2626 :<|> "delete" :> Header "ponies" String :> Delete '[JSON] NoContent
2727 :<|> "raw" :> Raw
28+ :<|> NoEndpoint
2829
2930
3031apiLink :: (IsElem endpoint TestApi, HasLink endpoint)
@@ -98,6 +99,11 @@ spec = describe "Servant.Utils.Links" $ do
9899-- ...Could not deduce...
99100-- ...
100101--
102+-- >>> apiLink (Proxy :: Proxy NoEndpoint)
103+-- ...
104+-- ...No instance for...
105+-- ...
106+--
101107-- sanity check
102108-- >>> toUrlPiece $ apiLink (Proxy :: Proxy AllGood)
103109-- "get"
@@ -107,3 +113,4 @@ type WrongContentType = "get" :> Get '[OctetStream] NoContent
107113type WrongMethod = "get" :> Post '[JSON] NoContent
108114type NotALink = "hello" :> ReqBody '[JSON] 'True :> Get '[JSON] Bool
109115type AllGood = "get" :> Get '[JSON] NoContent
116+type NoEndpoint = "empty" :> EmptyAPI