Skip to content

Commit c48a670

Browse files
author
Gaël Deest
authored
Merge pull request #1582 from haskell-servant/named-routes-servant-docs
Add support for NamedRoutes in servant-docs
2 parents 117a2cc + 9c81b49 commit c48a670

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

servant-docs/src/Servant/Docs/Internal.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import GHC.TypeLits
6262
import Servant.API
6363
import Servant.API.ContentTypes
6464
import Servant.API.TypeLevel
65+
import Servant.API.Generic
6566

6667
import qualified Data.Universe.Helpers as U
6768

@@ -1150,6 +1151,9 @@ instance (ToAuthInfo (BasicAuth realm usr), HasDocs api) => HasDocs (BasicAuth r
11501151
authProxy = Proxy :: Proxy (BasicAuth realm usr)
11511152
action' = over authInfo (|> toAuthInfo authProxy) action
11521153

1154+
instance HasDocs (ToServantApi api) => HasDocs (NamedRoutes api) where
1155+
docsFor Proxy = docsFor (Proxy :: Proxy (ToServantApi api))
1156+
11531157
-- ToSample instances for simple types
11541158
instance ToSample NoContent
11551159
instance ToSample Bool

0 commit comments

Comments
 (0)