@@ -107,7 +107,7 @@ import Prelude.Compat
107107
108108import Web.HttpApiData
109109import Servant.API.BasicAuth ( BasicAuth )
110−import Servant.API.Capture ( Capture )
110+import Servant.API.Capture ( Capture, CaptureAll )
111111import Servant.API.ReqBody ( ReqBody )
112112import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
113113import Servant.API.Header ( Header )
@@ -163,6 +163,8 @@ type family IsElem endpoint api :: Constraint where
163163 IsElem sa (ReqBody y x :> sb) = IsElem sa sb
164164 IsElem (Capture z y :> sa) (Capture x y :> sb)
165165 = IsElem sa sb
166+ IsElem (CaptureAll z y :> sa) (CaptureAll x y :> sb)
167+ = IsElem sa sb
166168 IsElem sa (QueryParam x y :> sb) = IsElem sa sb
167169 IsElem sa (QueryParams x y :> sb) = IsElem sa sb
168170 IsElem sa (QueryFlag x :> sb) = IsElem sa sb
@@ -284,6 +286,13 @@ instance (ToHttpApiData v, HasLink sub)
284286 toLink (Proxy :: Proxy sub) $
285287 addSegment (escape . Text.unpack $ toUrlPiece v) l
286288
289+instance (ToHttpApiData v, HasLink sub)
290+ => HasLink (CaptureAll sym v :> sub) where
291+ type MkLink (CaptureAll sym v :> sub) = [v] -> MkLink sub
292+ toLink _ l vs =
293+ toLink (Proxy :: Proxy sub) $
294+ foldl' (flip $ addSegment . escape . Text.unpack . toUrlPiece) l vs
295+
287296instance HasLink sub => HasLink (Header sym a :> sub) where
288297 type MkLink (Header sym a :> sub) = MkLink sub
289298 toLink _ = toLink (Proxy :: Proxy sub)