From bef6d3e6ef1733f8bd8c5af26f54ed7b02b52998 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 17:02:02 +0000 Subject: [PATCH 1/7] Initial plan From f6b61f1063ebbc0a8f78804b0af51015667f9822 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 17:18:31 +0000 Subject: [PATCH 2/7] fix: revert accidental TypeProviders.SDK and FSharp.Data upgrades in paket.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ca9d297 commit ('fix: downgrade fsharp.core') accidentally also upgraded FSharp.TypeProviders.SDK (32fd6037 → 821de018) and FSharp.Data (1ee7eaf8 → 00034f9a) while only intending to downgrade FSharp.Core in the Server project group. TypeProviders.SDK 821de018 introduced Windows-specific NullReferenceExceptions in type providers: - v2/Swagger.i0027.Tests.fs with SwaggerTypeProvider (PR branch) - v3/Swashbuckle.ReturnControllers.Tests.fs with OpenApiClientTypeProvider (master) Revert TypeProviders.SDK back to 32fd6037 and FSharp.Data back to 1ee7eaf8 — the versions confirmed working in CI run 23306033036 — while preserving the FSharp.Core downgrade that was the intent of ca9d297. Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com> --- paket.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paket.lock b/paket.lock index 48558e1..bd03a49 100644 --- a/paket.lock +++ b/paket.lock @@ -45,11 +45,11 @@ NUGET YamlDotNet (16.3) GITHUB remote: fsprojects/FSharp.TypeProviders.SDK - src/ProvidedTypes.fs (821de018b4fad3c9f8b4e2b743b99b86ff4e475f) - src/ProvidedTypes.fsi (821de018b4fad3c9f8b4e2b743b99b86ff4e475f) + src/ProvidedTypes.fs (32fd6037e053d5d7ed532b84b836eb92fc8784b3) + src/ProvidedTypes.fsi (32fd6037e053d5d7ed532b84b836eb92fc8784b3) remote: fsprojects/FSharp.Data - src/FSharp.Data.Runtime.Utilities/NameUtils.fs (00034f9ae8b1803c296261d82dead736428e50d9) - src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (00034f9ae8b1803c296261d82dead736428e50d9) + src/FSharp.Data.Runtime.Utilities/NameUtils.fs (1ee7eaf811a08a780addbfb2e40dbb69700e7b2b) + src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (1ee7eaf811a08a780addbfb2e40dbb69700e7b2b) GROUP Server RESTRICTION: == net10.0 NUGET From dd2a83d3a699dec9f0f240864c5194e183eb5d8f Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sun, 22 Mar 2026 15:56:15 +0100 Subject: [PATCH 3/7] feat: update TP SDK --- paket.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/paket.lock b/paket.lock index bd03a49..95a4ac7 100644 --- a/paket.lock +++ b/paket.lock @@ -8,10 +8,10 @@ NUGET Microsoft.Bcl.AsyncInterfaces (10.0.5) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) System.Threading.Tasks.Extensions (>= 4.6.3) - restriction: || (>= net462) (&& (>= netstandard2.0) (< netstandard2.1)) Microsoft.NETCore.Platforms (7.0.4) - restriction: >= net461 - Microsoft.OpenApi (2.7) + Microsoft.OpenApi (2.7.1) System.Text.Json (>= 8.0.5) - restriction: >= netstandard2.0 - Microsoft.OpenApi.YamlReader (2.7) - Microsoft.OpenApi (>= 2.7) - restriction: >= netstandard2.0 + Microsoft.OpenApi.YamlReader (2.7.1) + Microsoft.OpenApi (>= 2.7.1) - restriction: >= netstandard2.0 SharpYaml (>= 2.1.4) - restriction: >= netstandard2.0 System.Text.Json (>= 8.0.5) - restriction: >= netstandard2.0 NETStandard.Library (2.0.3) - restriction: >= net461 @@ -45,11 +45,11 @@ NUGET YamlDotNet (16.3) GITHUB remote: fsprojects/FSharp.TypeProviders.SDK - src/ProvidedTypes.fs (32fd6037e053d5d7ed532b84b836eb92fc8784b3) - src/ProvidedTypes.fsi (32fd6037e053d5d7ed532b84b836eb92fc8784b3) + src/ProvidedTypes.fs (dffd529ffef00434598f462f9f845561f49c2e9a) + src/ProvidedTypes.fsi (dffd529ffef00434598f462f9f845561f49c2e9a) remote: fsprojects/FSharp.Data - src/FSharp.Data.Runtime.Utilities/NameUtils.fs (1ee7eaf811a08a780addbfb2e40dbb69700e7b2b) - src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (1ee7eaf811a08a780addbfb2e40dbb69700e7b2b) + src/FSharp.Data.Runtime.Utilities/NameUtils.fs (00034f9ae8b1803c296261d82dead736428e50d9) + src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (00034f9ae8b1803c296261d82dead736428e50d9) GROUP Server RESTRICTION: == net10.0 NUGET @@ -452,7 +452,7 @@ NUGET Microsoft.Extensions.Options (>= 10.0.5) Microsoft.Net.Http.Headers (10.0.5) Microsoft.Extensions.Primitives (>= 10.0.5) - Microsoft.OpenApi (2.7) + Microsoft.OpenApi (2.7.1) System.Text.Json (>= 8.0.5) Newtonsoft.Json (13.0.4) Newtonsoft.Json.Bson (1.0.3) @@ -569,7 +569,7 @@ NUGET Microsoft.NET.Test.Sdk (18.3) Microsoft.CodeCoverage (>= 18.3) Microsoft.TestPlatform.TestHost (>= 18.3) - Microsoft.OpenApi (2.7) + Microsoft.OpenApi (2.7.1) System.Text.Json (>= 8.0.5) Microsoft.Testing.Extensions.Telemetry (2.1) Microsoft.ApplicationInsights (>= 2.23) From a634e4cac6520be3919663f635cdf11775877fcd Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Sun, 22 Mar 2026 16:11:06 +0100 Subject: [PATCH 4/7] fix: formatting --- .../v3/Schema.TypeMappingTests.fs | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs b/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs index ece4c0a..9690828 100644 --- a/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs +++ b/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs @@ -46,6 +46,7 @@ components: opCompiler.CompileProvidedClients(defCompiler.Namespace) let types = defCompiler.Namespace.GetProvidedTypes() + let testType = types |> List.find(fun t -> t.Name = "TestType") match testType.GetDeclaredProperty("Value") with @@ -118,7 +119,8 @@ let ``required string byte format maps to byte array``() = let ty = compilePropertyType " type: string\n format: byte\n" true // DefinitionCompiler creates a rank-1 explicit array via MakeArrayType(1) - ty |> shouldEqual(typeof.MakeArrayType(1)) + let expected = typeof.MakeArrayType(1) + ty |> shouldEqual expected [] let ``required string binary format maps to Stream``() = @@ -133,50 +135,55 @@ let ``required string binary format maps to Stream``() = let ``optional boolean maps to Option``() = let ty = compilePropertyType " type: boolean\n" false - ty |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected [] let ``optional integer maps to Option``() = let ty = compilePropertyType " type: integer\n" false - ty |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected [] let ``optional integer int64 maps to Option``() = let ty = compilePropertyType " type: integer\n format: int64\n" false - ty |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected [] let ``optional number maps to Option``() = let ty = compilePropertyType " type: number\n" false - ty - |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected [] let ``optional number double maps to Option``() = let ty = compilePropertyType " type: number\n format: double\n" false - ty - |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected [] let ``optional DateTimeOffset maps to Option``() = let ty = compilePropertyType " type: string\n format: date-time\n" false - ty - |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + + ty |> shouldEqual expected [] let ``optional Guid maps to Option``() = let ty = compilePropertyType " type: string\n format: uuid\n" false - ty |> shouldEqual(typedefof>.MakeGenericType(typeof)) + let expected = typedefof>.MakeGenericType(typeof) + ty |> shouldEqual expected // ── Optional reference types are NOT wrapped (they are already nullable) ───── @@ -184,7 +191,7 @@ let ``optional Guid maps to Option``() = let ``optional string is not wrapped in Option``() = let ty = compilePropertyType " type: string\n" false - // string is a reference type — not wrapped in Option even when non-required + // string is a reference type -- not wrapped in Option even when non-required ty |> shouldEqual typeof [] @@ -192,5 +199,6 @@ let ``optional byte array is not wrapped in Option``() = let ty = compilePropertyType " type: string\n format: byte\n" false - // byte[*] is a reference type — not wrapped in Option - ty |> shouldEqual(typeof.MakeArrayType(1)) + // byte[*] is a reference type -- not wrapped in Option + let expected = typeof.MakeArrayType(1) + ty |> shouldEqual expected From b66819fecf372009d9d0265531d775c4d694c170 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:30:06 +0000 Subject: [PATCH 5/7] fix: format Schema.TypeMappingTests.fs to pass CI formatting check Apply Fantomas-required blank lines in match expression bodies and incorporate base branch changes (module rename, null-safety checks) to ensure the merged PR result passes the CheckFormat target. Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com> Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/3bf98de8-e32b-4375-a14a-a98e3b3103ce --- build.fsx.lock | 5 +++++ .../v3/Schema.TypeMappingTests.fs | 20 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 build.fsx.lock diff --git a/build.fsx.lock b/build.fsx.lock new file mode 100644 index 0000000..4126e00 --- /dev/null +++ b/build.fsx.lock @@ -0,0 +1,5 @@ +STORAGE: NONE +RESTRICTION: || (== net6.0) (== netstandard2.0) +NUGET + remote: https://api.nuget.org/v3/index.json + FSharp.Core (10.1.201) diff --git a/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs b/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs index 9690828..99e980e 100644 --- a/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs +++ b/tests/SwaggerProvider.Tests/v3/Schema.TypeMappingTests.fs @@ -1,7 +1,6 @@ -module SwaggerProvider.Tests.V3TypeMappingTests +module SwaggerProvider.Tests.v3.Schema.TypeMappingTests open System -open System.IO open Microsoft.OpenApi.Reader open SwaggerProvider.Internal.v3.Compilers open Xunit @@ -39,7 +38,22 @@ components: let readResult = Microsoft.OpenApi.OpenApiDocument.Parse(schemaStr, settings = settings) - let schema = readResult.Document + // Ensure the schema was parsed successfully before using it + match readResult.Diagnostic with + | null -> () + | diagnostic when diagnostic.Errors |> Seq.isEmpty |> not -> + let errorText = + diagnostic.Errors + |> Seq.map string + |> String.concat Environment.NewLine + + failwithf "Failed to parse OpenAPI schema:%s%s" Environment.NewLine errorText + | _ -> () + + let schema = + match readResult.Document with + | null -> failwith "Failed to parse OpenAPI schema: Document is null." + | doc -> doc let defCompiler = DefinitionCompiler(schema, false) let opCompiler = OperationCompiler(schema, defCompiler, true, false, true) From 5304fec730b32151b9caf1964289f4a7e6d6bd11 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:30:34 +0000 Subject: [PATCH 6/7] chore: add build.fsx.lock to .gitignore Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com> Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/3bf98de8-e32b-4375-a14a-a98e3b3103ce --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8693eb3..1b76605 100644 --- a/.gitignore +++ b/.gitignore @@ -340,4 +340,4 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb -.ionide \ No newline at end of file +.ionidebuild.fsx.lock From a6cf7e3ee9cc2153905dba64f129d0d4af3bab3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 15:31:19 +0000 Subject: [PATCH 7/7] chore: fix .gitignore formatting - add newline before build.fsx.lock Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com> Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/3bf98de8-e32b-4375-a14a-a98e3b3103ce --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1b76605..b20040b 100644 --- a/.gitignore +++ b/.gitignore @@ -340,4 +340,5 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb -.ionidebuild.fsx.lock +.ionide +build.fsx.lock