@@ -46,6 +46,7 @@ type TestApi
4646 :<|> "test" :> QueryParam "param" Int :> ReqBody '[JSON] [String] :> Post '[JSON] NoContent
4747 :<|> "test" :> QueryParams "params" Int :> ReqBody '[JSON] String :> Put '[JSON] NoContent
4848 :<|> "test" :> Capture "id" Int :> Delete '[JSON] NoContent
49+ :<|> "test" :> CaptureAll "ids" Int :> Get '[JSON] [Int]
4950
5051testApi :: [Req String]
5152testApi = listFromAPI (Proxy :: Proxy LangX) (Proxy :: Proxy String) (Proxy :: Proxy TestApi)
@@ -53,9 +54,9 @@ testApi = listFromAPI (Proxy :: Proxy LangX) (Proxy :: Proxy String) (Proxy :: P
5354listFromAPISpec :: Spec
5455listFromAPISpec = describe "listFromAPI" $ do
5556 it "generates 4 endpoints for TestApi" $ do
56− length testApi `shouldBe` 4
57+ length testApi `shouldBe` 5
5758
58− let [getReq, postReq, putReq, deleteReq] = testApi
59+ let [getReq, postReq, putReq, deleteReq, captureAllReq] = testApi
5960
6061 it "collects all info for get request" $ do
6162 shouldBe getReq $ defReq
@@ -106,3 +107,16 @@ listFromAPISpec = describe "listFromAPI" $ do
106107 , _reqReturnType = Just "voidX"
107108 , _reqFuncName = FunctionName ["delete", "test", "by", "id"]
108109 }
110+
111+ it "collects all info for capture all request" $ do
112+ shouldBe captureAllReq $ defReq
113+ { _reqUrl = Url
114+ [ Segment $ Static "test"
115+ , Segment $ Cap (Arg "ids" "listX of intX") ]
116+ []
117+ , _reqMethod = "GET"
118+ , _reqHeaders = []
119+ , _reqBody = Nothing
120+ , _reqReturnType = Just "listX of intX"
121+ , _reqFuncName = FunctionName ["get", "test", "by", "ids"]
122+ }