@@ -44,6 +44,11 @@ import Control.Monad.Trans.Either (EitherT)
4444#endif
4545#endif
4646
47+#if MIN_VERSION_servant(0,12,0)
48+#define SUMMARY(d) Summary d :>
49+#else
50+#define SUMMARY(d)
51+#endif
4752
4853-- data types
4954data Cat = Cat { catName :: CatName, catIsMale :: Bool }
@@ -72,10 +77,10 @@ instance ToSchema CatName
7277
7378-- api
7479type BasicAPI = Get '[PlainText, JSON] Text
75− :<|> "cat" :> Capture ":name" CatName :> Get '[JSON] Cat
76− :<|> "cat2" :> Capture ":name" CatName :> Get '[JSON] Cat
77− :<|> "cat3" :> Capture ":name" CatName :> Get '[JSON] Cat
78− :<|> "post-cat" :> ReqBody '[JSON] Cat :> Get '[JSON] Cat
80+ :<|> SUMMARY("First cat") "cat" :> Capture ":name" CatName :> Get '[JSON] Cat
81+ :<|> SUMMARY("Second cat") "cat2" :> Capture ":name" CatName :> Get '[JSON] Cat
82+ :<|> SUMMARY("Third cat") "cat3" :> Capture ":name" CatName :> Get '[JSON] Cat
83+ :<|> SUMMARY("Post endpoint") "post-cat" :> ReqBody '[JSON] Cat :> Get '[JSON] Cat
7984
8085type API =
8186 -- this serves both: swagger.json and swagger-ui