Skip to content

Commit

Permalink
servant-swagger: add HasSwagger instance for NamedRoutes
Browse files Browse the repository at this point in the history
  • Loading branch information
LightAndLight committed May 3, 2022
1 parent 5e1569e commit cb310b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servant-swagger/src/Servant/Swagger/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import Network.HTTP.Media (MediaType)
import Servant.API
import Servant.API.Description (FoldDescription,
reflectDescription)
import Servant.API.Generic (ToServantApi)
import Servant.API.Modifiers (FoldRequired)

import Servant.Swagger.Internal.TypeLevel.API
Expand Down Expand Up @@ -439,6 +440,9 @@ instance (ToSchema a, Accept ct, HasSwagger sub, KnownSymbol (FoldDescription mo
& required ?~ True
& 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
-- =======================================================================
Expand Down

0 comments on commit cb310b8

Please sign in to comment.