@@ -862,7 +862,7 @@ instance HasDocs EmptyAPI where
862-- | @"books" :> 'Capture' "isbn" Text@ will appear as
862-- | @"books" :> 'Capture' "isbn" Text@ will appear as
863-- @/books/:isbn@ in the docs.
863-- @/books/:isbn@ in the docs.
864instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
864instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
865− => HasDocs (Capture' mods sym a :> api) where
865+ => HasDocs (Capture' '[] sym a :> api) where
867 docsFor Proxy (endpoint, action) =
867 docsFor Proxy (endpoint, action) =
868 docsFor subApiP (endpoint', action')
868 docsFor subApiP (endpoint', action')
@@ -874,6 +874,28 @@ instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
874 endpoint' = over path (\p -> p ++ [":" ++ symbolVal symP]) endpoint
874 endpoint' = over path (\p -> p ++ [":" ++ symbolVal symP]) endpoint
875 symP = Proxy :: Proxy sym
875 symP = Proxy :: Proxy sym
877+instance (KnownSymbol descr, KnownSymbol sym, HasDocs api)
878+ => HasDocs (Capture' (Description descr ': mods) sym a :> api) where
880+ docsFor Proxy (endpoint, action) =
881+ docsFor subApiP (endpoint', action')
883+ where subApiP = Proxy :: Proxy api
885+ docCapture = DocCapture (symbolVal symP) (symbolVal descrP)
886+ action' = over captures (|> docCapture) action
887+ endpoint' = over path (\p -> p ++ [":" ++ symbolVal symP]) endpoint
888+ descrP = Proxy :: Proxy descr
889+ symP = Proxy :: Proxy sym
891+instance {-# OVERLAPPABLE #-} HasDocs (Capture' mods sym a :> api)
892+ => HasDocs (Capture' (mod ': mods) sym a :> api) where
897+ where apiP = Proxy :: Proxy (Capture' mods sym a :> api)
878-- | @"books" :> 'CaptureAll' "isbn" Text@ will appear as
900-- | @"books" :> 'CaptureAll' "isbn" Text@ will appear as
879-- @/books/:isbn@ in the docs.
901-- @/books/:isbn@ in the docs.