Merge pull request #1582 from haskell-servant/named-routes-servant-docs

Add support for NamedRoutes in servant-docs
This commit is contained in:
Gaël Deest 2022-04-19 13:13:50 +02:00 committed by GitHub
commit c48a6702b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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
@ -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