on master help sign in
servant-swagger: add HasSwagger instance for NamedRoutes
commitcb310b8294abb13cc1345151ba91ffcf3c9e1853 authorIsaac Elliott <isaace71295@gmail.com> dateFri 29 Apr 2022, 14:50 (4 years ago) parent5e1569e
1 file changed+4
servant-swagger/src/Servant/Swagger/Internal.hs+4
servant-swagger/src/Servant/Swagger/Internal.hs+4
@@ -35,6 +35,7 @@ import Network.HTTP.Media (MediaType)
3535import Servant.API
3636import Servant.API.Description (FoldDescription,
3737 reflectDescription)
38+import Servant.API.Generic (ToServantApi)
3839import Servant.API.Modifiers (FoldRequired)
3940
4041import Servant.Swagger.Internal.TypeLevel.API
@@ -439,6 +440,9 @@ instance (ToSchema a, Accept ct, HasSwagger sub, KnownSymbol (FoldDescription mo
439440 & required ?~ True
440441 & schema .~ ParamBody ref
441442
443+instance HasSwagger (ToServantApi routes) => HasSwagger (NamedRoutes routes) where
444+ toSwagger _ = toSwagger (Proxy :: Proxy (ToServantApi routes))
445+
442446-- =======================================================================
443447-- Below are the definitions that should be in Servant.API.ContentTypes
444448-- =======================================================================