servant-swagger: add HasSwagger instance for NamedRoutes
This commit is contained in:
parent
5e1569e9e2
commit
cb310b8294
1 changed files with 4 additions and 0 deletions
|
@ -35,6 +35,7 @@ import Network.HTTP.Media (MediaType)
|
||||||
import Servant.API
|
import Servant.API
|
||||||
import Servant.API.Description (FoldDescription,
|
import Servant.API.Description (FoldDescription,
|
||||||
reflectDescription)
|
reflectDescription)
|
||||||
|
import Servant.API.Generic (ToServantApi)
|
||||||
import Servant.API.Modifiers (FoldRequired)
|
import Servant.API.Modifiers (FoldRequired)
|
||||||
|
|
||||||
import Servant.Swagger.Internal.TypeLevel.API
|
import Servant.Swagger.Internal.TypeLevel.API
|
||||||
|
@ -439,6 +440,9 @@ instance (ToSchema a, Accept ct, HasSwagger sub, KnownSymbol (FoldDescription mo
|
||||||
& required ?~ True
|
& required ?~ True
|
||||||
& schema .~ ParamBody ref
|
& schema .~ ParamBody ref
|
||||||
|
|
||||||
|
instance HasSwagger (ToServantApi routes) => HasSwagger (NamedRoutes routes) where
|
||||||
|
toSwagger _ = toSwagger (Proxy :: Proxy (ToServantApi routes))
|
||||||
|
|
||||||
-- =======================================================================
|
-- =======================================================================
|
||||||
-- Below are the definitions that should be in Servant.API.ContentTypes
|
-- Below are the definitions that should be in Servant.API.ContentTypes
|
||||||
-- =======================================================================
|
-- =======================================================================
|
||||||
|
|
Loading…
Reference in a new issue