From 09bc8b23517e59be0f4bdb86d9ba8fe18fa07d7d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 20:16:34 +0000 Subject: [PATCH 1/2] Initial plan From 7d2d22e7c33d1cc3ac928bf981199f6afeccf51e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 20:21:08 +0000 Subject: [PATCH 2/2] Add missing toQueryParams test cases: float32/double/byte arrays and Option array types Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com> --- .../RuntimeHelpersTests.fs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/SwaggerProvider.Tests/RuntimeHelpersTests.fs b/tests/SwaggerProvider.Tests/RuntimeHelpersTests.fs index a290eddc..378f43fa 100644 --- a/tests/SwaggerProvider.Tests/RuntimeHelpersTests.fs +++ b/tests/SwaggerProvider.Tests/RuntimeHelpersTests.fs @@ -170,6 +170,42 @@ module ToQueryParamsTests = let result = toQueryParams "id" (box [| g1; g2 |]) stubClient result |> shouldEqual [ ("id", g1.ToString()); ("id", g2.ToString()) ] + [] + let ``toQueryParams handles float32 array``() = + let result = toQueryParams "v" (box [| 1.5f; 2.5f |]) stubClient + result |> shouldEqual [ ("v", "1.5"); ("v", "2.5") ] + + [] + let ``toQueryParams handles double array``() = + let result = toQueryParams "v" (box [| 1.5; 2.5 |]) stubClient + result |> shouldEqual [ ("v", "1.5"); ("v", "2.5") ] + + [] + let ``toQueryParams handles byte array as base64``() = + // byte[] is serialized via client.Serialize (JSON base64) with surrounding quotes trimmed + let bytes = [| 72uy; 101uy; 108uy; 108uy; 111uy |] // "Hello" in ASCII + let expected = (JsonSerializer.Serialize bytes).Trim('"') + let result = toQueryParams "data" (box bytes) stubClient + result |> shouldEqual [ ("data", expected) ] + + [] + let ``toQueryParams skips None items in Option array``() = + let values: Option[] = [| Some "a"; None; Some "c" |] + let result = toQueryParams "q" (box values) stubClient + result |> shouldEqual [ ("q", "a"); ("q", "c") ] + + [] + let ``toQueryParams skips None items in Option array``() = + let values: Option[] = [| Some 1.5f; None; Some 3.5f |] + let result = toQueryParams "v" (box values) stubClient + result |> shouldEqual [ ("v", "1.5"); ("v", "3.5") ] + + [] + let ``toQueryParams skips None items in Option array``() = + let values: Option[] = [| Some 1.5; None; Some 3.5 |] + let result = toQueryParams "v" (box values) stubClient + result |> shouldEqual [ ("v", "1.5"); ("v", "3.5") ] + module CombineUrlTests =