Skip to content

Commit

Permalink
Merge pull request #1582 from haskell-servant/named-routes-servant-docs
Browse files Browse the repository at this point in the history
Add support for NamedRoutes in servant-docs
  • Loading branch information
Gaël Deest committed Apr 19, 2022
2 parents 117a2cc + 9c81b49 commit c48a670
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servant-docs/src/Servant/Docs/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import GHC.TypeLits
import Servant.API
import Servant.API.ContentTypes
import Servant.API.TypeLevel
import Servant.API.Generic

import qualified Data.Universe.Helpers as U

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

instance HasDocs (ToServantApi api) => HasDocs (NamedRoutes api) where
docsFor Proxy = docsFor (Proxy :: Proxy (ToServantApi api))

-- ToSample instances for simple types
instance ToSample NoContent
instance ToSample Bool
Expand Down

0 comments on commit c48a670

Please sign in to comment.