diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8ba49f1..ceef264 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,14 +3,14 @@ "isRoot": true, "tools": { "paket": { - "version": "9.0.2", + "version": "10.0.0-alpha011", "commands": [ "paket" ], "rollForward": false }, "dotnet-serve": { - "version": "1.10.175", + "version": "1.10.190", "commands": [ "dotnet-serve" ], diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index af150dd..aafc2b4 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Setup .NET 9.0 SDK + - name: Setup .NET 10.0 SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: "9.0.x" + dotnet-version: "10.0.x" - name: Install local tools run: dotnet tool restore - name: Paket Restore diff --git a/AGENTS.md b/AGENTS.md index 90ec38b..1b7b8fa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,17 +4,17 @@ - **Format Check**: `dotnet fake build -t CheckFormat` (validates Fantomas formatting) - **Format**: `dotnet fake build -t Format` (applies Fantomas formatting) - **All Tests**: `dotnet fake build -t RunTests` (builds + starts test server + runs all tests) -- **Unit Tests Only**: `dotnet build && dotnet tests/SwaggerProvider.Tests/bin/Release/net9.0/SwaggerProvider.Tests.dll` +- **Unit Tests Only**: `dotnet build && dotnet tests/SwaggerProvider.Tests/bin/Release/net10.0/SwaggerProvider.Tests.dll` - **Provider Tests (Integration)**: 1. Build test server: `dotnet build tests/Swashbuckle.WebApi.Server/Swashbuckle.WebApi.Server.fsproj -c Release` - 2. Start server in background: `dotnet tests/Swashbuckle.WebApi.Server/bin/Release/net9.0/Swashbuckle.WebApi.Server.dll` + 2. Start server in background: `dotnet tests/Swashbuckle.WebApi.Server/bin/Release/net10.0/Swashbuckle.WebApi.Server.dll` 3. Build tests: `dotnet build SwaggerProvider.TestsAndDocs.sln -c Release` - 4. Run tests: `dotnet tests/SwaggerProvider.ProviderTests/bin/Release/net9.0/SwaggerProvider.ProviderTests.dll` + 4. Run tests: `dotnet tests/SwaggerProvider.ProviderTests/bin/Release/net10.0/SwaggerProvider.ProviderTests.dll` - **Single Test**: Run via xunit runner: `dotnet [assembly] [filter]` ## Code Style Guidelines -**Language**: F# (net9.0 target framework) +**Language**: F# (net10.0 target framework) **Imports & Namespaces**: @@ -60,4 +60,4 @@ - Type Providers use `ProvidedApiClientBase` and compiler pipeline (DefinitionCompiler, OperationCompiler) - SSRF protection enabled by default; disable with `SsrfProtection=false` static parameter -- Target net9.0; use implicit async/await (task expressions) +- Target net10.0; use implicit async/await (task expressions) diff --git a/README.md b/README.md index ac3167a..ff723fa 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# SwaggerProvider [![NuGet Badge](https://buildstats.info/nuget/SwaggerProvider)](https://www.nuget.org/packages/SwaggerProvider) +# SwaggerProvider -This SwaggerProvider can be used to access RESTful API generated using [Swagger.io](http://swagger.io) +![NuGet Version](https://badgen.net/nuget/v/SwaggerProvider) ![NuGet Downloads](https://badgen.net/nuget/dt/SwaggerProvider) -[![Build Status](https://github.com/fsprojects/SwaggerProvider/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/fsprojects/SwaggerProvider/actions?query=branch%3Amaster) +This SwaggerProvider can be used to access RESTful API generated using [Swagger.io](http://swagger.io) -Documentation: http://fsprojects.github.io/SwaggerProvider/ +Documentation: **Security:** SSRF protection is enabled by default. For local development, use static parameter `SsrfProtection=false`. @@ -13,10 +13,8 @@ Documentation: http://fsprojects.github.io/SwaggerProvider/ Swagger is available for ASP.NET WebAPI APIs with [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle). Also possible to [Create an ASP.NET API app in Azure App Service](https://azure.microsoft.com/en-us/documentation/articles/app-service-dotnet-create-api-app/) - ## Maintainer(s) - [@sergey-tihon](https://github.com/sergey-tihon) The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management) - diff --git a/build.fsx b/build.fsx index 363efc0..0729562 100644 --- a/build.fsx +++ b/build.fsx @@ -91,7 +91,7 @@ let webApiInputStream = StreamRef.Empty Target.create "StartServer" (fun _ -> Target.activateFinal "StopServer" - CreateProcess.fromRawCommandLine "dotnet" "tests/Swashbuckle.WebApi.Server/bin/Release/net9.0/Swashbuckle.WebApi.Server.dll" + CreateProcess.fromRawCommandLine "dotnet" "tests/Swashbuckle.WebApi.Server/bin/Release/net10.0/Swashbuckle.WebApi.Server.dll" |> CreateProcess.withStandardInput(CreatePipe webApiInputStream) |> Proc.start |> ignore @@ -116,9 +116,9 @@ Target.create "BuildTests" (fun _ -> dotnet "build" "SwaggerProvider.TestsAndDoc let runTests assembly = dotnet $"{assembly}" "" -Target.create "RunUnitTests" (fun _ -> runTests "tests/SwaggerProvider.Tests/bin/Release/net9.0/SwaggerProvider.Tests.dll") +Target.create "RunUnitTests" (fun _ -> runTests "tests/SwaggerProvider.Tests/bin/Release/net10.0/SwaggerProvider.Tests.dll") -Target.create "RunIntegrationTests" (fun _ -> runTests "tests/SwaggerProvider.ProviderTests/bin/Release/net9.0/SwaggerProvider.ProviderTests.dll") +Target.create "RunIntegrationTests" (fun _ -> runTests "tests/SwaggerProvider.ProviderTests/bin/Release/net10.0/SwaggerProvider.ProviderTests.dll") Target.create "RunTests" ignore diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index d47c622..a53913f 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,3 +1,11 @@ +#### 3.0.0 - Nov 15, 2025 + +- Server-Side Request Forgery (SSRF) protection (#271) +- SSRF for IP V6 and Tests (#272) +- Microsoft.OpenApi v3.0 with OpenAPI v3.1 Support +- Removed dependency on Microsoft.OpenApi.Readers +- Dependencies update + #### 2.3.2 - Oct 11, 2025 - Added support for `text/*` media type (#270) by @spaasis diff --git a/global.json b/global.json index 45f790c..fcb4599 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.101", + "version": "10.0.100", "rollForward": "minor" } } diff --git a/paket.dependencies b/paket.dependencies index 3519eb2..edd4c21 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -1,11 +1,12 @@ -version 8.0.3 +version 9.0.2 source https://api.nuget.org/v3/index.json storage: none -nuget FSharp.Core ~> 6 // We need task{} CE from F# 6.0 -nuget System.Text.Json ~> 6 +nuget FSharp.Core ~> 8 +nuget System.Text.Json ~> 8 nuget FSharp.SystemTextJson -nuget Microsoft.OpenApi.Readers +nuget Microsoft.OpenApi ~> 2 # https://github.com/microsoft/OpenAPI.NET/blob/main/CONTRIBUTING.md#branches-and-support-policy +nuget Microsoft.OpenApi.YamlReader nuget NETStandard.Library.NETFramework # delete when we drop custom parser for v2 @@ -20,20 +21,20 @@ github fsprojects/FSharp.Data:main src/FSharp.Data.Runtime.Utilities/NameUtils.f group Server source https://api.nuget.org/v3/index.json - framework: net9.0 + framework: net10.0 nuget Microsoft.AspNetCore nuget Microsoft.AspNetCore.Mvc nuget Microsoft.AspNetCore.HttpsPolicy nuget Swashbuckle.AspNetCore - nuget Microsoft.OpenApi + nuget Microsoft.OpenApi ~> 2 nuget FSharp.Core nuget System.Text.Json group Test source https://api.nuget.org/v3/index.json - frameworks: net9.0 + frameworks: net10.0 nuget FSharp.Compiler.Service nuget FSharp.Core @@ -41,5 +42,5 @@ group Test nuget Microsoft.NET.Test.Sdk nuget FsUnit.Xunit - nuget Microsoft.OpenApi.Readers redirects: force + nuget Microsoft.OpenApi ~> 2 nuget FSharp.SystemTextJson diff --git a/paket.lock b/paket.lock index f143915..1438183 100644 --- a/paket.lock +++ b/paket.lock @@ -1,59 +1,60 @@ STORAGE: NONE NUGET remote: https://api.nuget.org/v3/index.json - FSharp.Core (6.0.7) - FSharp.SystemTextJson (1.3.13) + FSharp.Core (8.0.403) + FSharp.SystemTextJson (1.4.36) FSharp.Core (>= 4.7) - restriction: >= netstandard2.0 - System.Text.Json (>= 6.0) - restriction: >= netstandard2.0 - Microsoft.Bcl.AsyncInterfaces (9.0.1) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (>= net462) (&& (>= netstandard2.0) (< netstandard2.1)) + System.Text.Json (>= 6.0.10) - restriction: >= netstandard2.0 + Microsoft.Bcl.AsyncInterfaces (10.0) - 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 (1.6.24) - restriction: >= netstandard2.0 - Microsoft.OpenApi.Readers (1.6.24) - Microsoft.OpenApi (>= 1.6.24) - restriction: >= netstandard2.0 - SharpYaml (>= 2.1.1) - restriction: >= netstandard2.0 + Microsoft.OpenApi (2.3.9) + System.Text.Json (>= 8.0.5) - restriction: >= netstandard2.0 + Microsoft.OpenApi.YamlReader (2.3.9) + Microsoft.OpenApi (>= 2.3.9) - 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 Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (>= net45) (< netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.4) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.4) (< netstandard1.5) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.6) (< netstandard2.0) (< win8) (< wpa81)) (&& (< net45) (>= netstandard2.0)) (&& (>= net46) (< netstandard1.4)) (>= net461) (>= netcoreapp2.0) (&& (>= netstandard1.0) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8) (< win8)) (&& (< netstandard1.0) (< portable-net45+win8) (>= portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8+wp8+wpa81) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= win8)) (&& (< netstandard1.3) (< win8) (>= wpa81)) (&& (< netstandard1.5) (>= uap10.0)) (>= uap10.1) (>= wp8) NETStandard.Library.NETFramework (2.0.0-preview2-25405-01) Microsoft.NETCore.Platforms (>= 2.0.0-preview2-25405-01) - restriction: >= net461 NETStandard.Library (>= 2.0.0-preview2-25401-01) - restriction: >= net461 - SharpYaml (2.1.1) - restriction: >= netstandard2.0 - System.Buffers (4.6) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp2.1) (>= netstandard2.0)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Memory (4.6) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Buffers (>= 4.6) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0)) - System.Numerics.Vectors (>= 4.6) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0)) - System.Runtime.CompilerServices.Unsafe (>= 6.1) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0)) - System.Numerics.Vectors (4.6) - restriction: || (>= net461) (&& (< netcoreapp2.1) (>= netstandard2.0)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Runtime.CompilerServices.Unsafe (6.1) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp2.1) (>= netstandard2.0)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Text.Encodings.Web (9.0.1) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Buffers (>= 4.5.1) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) - System.Memory (>= 4.5.5) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) - System.Text.Json (6.0.11) - Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Buffers (>= 4.5.1) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Memory (>= 4.5.4) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Numerics.Vectors (>= 4.5) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Text.Encodings.Web (>= 6.0.1) - restriction: || (>= net461) (&& (< net6.0) (>= netcoreapp3.1)) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) - System.ValueTuple (>= 4.5) - restriction: >= net461 - System.Threading.Tasks.Extensions (4.6) - restriction: || (>= net461) (&& (< netcoreapp3.1) (>= netstandard2.0)) (&& (>= netstandard2.0) (< netstandard2.1)) - System.Runtime.CompilerServices.Unsafe (>= 6.1) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0)) - System.ValueTuple (4.6.1) - restriction: >= net461 + SharpYaml (2.1.4) - restriction: >= netstandard2.0 + System.Buffers (4.6.1) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) (&& (>= net7.0) (< net8.0)) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Memory (4.6.3) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) (&& (>= net7.0) (< net8.0)) + System.Buffers (>= 4.6.1) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Numerics.Vectors (>= 4.6.1) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Numerics.Vectors (4.6.1) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Runtime.CompilerServices.Unsafe (6.1.2) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) (&& (>= net7.0) (< net8.0)) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.Text.Encodings.Web (10.0) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) (&& (>= net7.0) (< net8.0)) + System.Buffers (>= 4.6.1) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) + System.Memory (>= 4.6.3) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) + System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (>= net462) (&& (< net8.0) (>= netstandard2.0)) + System.Text.Json (8.0.6) + Microsoft.Bcl.AsyncInterfaces (>= 8.0) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) + System.Buffers (>= 4.5.1) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) + System.Memory (>= 4.5.5) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) + System.Runtime.CompilerServices.Unsafe (>= 6.0) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) + System.Text.Encodings.Web (>= 8.0) - restriction: || (>= net462) (&& (>= net6.0) (< net7.0)) (&& (< net6.0) (>= netstandard2.0)) (&& (>= net7.0) (< net8.0)) + System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) + System.ValueTuple (>= 4.5) - restriction: >= net462 + System.Threading.Tasks.Extensions (4.6.3) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0)) (&& (>= netstandard2.0) (< netstandard2.1)) + System.Runtime.CompilerServices.Unsafe (>= 6.1.2) - restriction: || (>= net462) (&& (< netcoreapp2.1) (>= netstandard2.0) (< netstandard2.1)) + System.ValueTuple (4.6.1) - restriction: >= net462 YamlDotNet (16.3) GITHUB remote: fsprojects/FSharp.TypeProviders.SDK - src/ProvidedTypes.fs (3b22420be5eddecaee89105d208cc4fb7b2e4df3) - src/ProvidedTypes.fsi (3b22420be5eddecaee89105d208cc4fb7b2e4df3) + src/ProvidedTypes.fs (ce34c1cc71096857b8342f1dedf93391addc9df6) + src/ProvidedTypes.fsi (ce34c1cc71096857b8342f1dedf93391addc9df6) remote: fsprojects/FSharp.Data - src/FSharp.Data.Runtime.Utilities/NameUtils.fs (db461d259bbaba330ca0c9255e9b957043a34b84) - src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (db461d259bbaba330ca0c9255e9b957043a34b84) + src/FSharp.Data.Runtime.Utilities/NameUtils.fs (9e8299ad6f940d29254620775c2c23983bdd797e) + src/FSharp.Data.Runtime.Utilities/Pluralizer.fs (9e8299ad6f940d29254620775c2c23983bdd797e) GROUP Server -RESTRICTION: == net9.0 +RESTRICTION: == net10.0 NUGET remote: https://api.nuget.org/v3/index.json - FSharp.Core (9.0.101) + FSharp.Core (10.0.100) Microsoft.AspNetCore (2.3) Microsoft.AspNetCore.Diagnostics (>= 2.3) Microsoft.AspNetCore.HostFiltering (>= 2.3) @@ -86,31 +87,32 @@ NUGET Microsoft.AspNetCore.Authentication.Abstractions (>= 2.3) Microsoft.AspNetCore.Http (>= 2.3) Microsoft.AspNetCore.Http.Extensions (>= 2.3) - Microsoft.AspNetCore.Authorization (9.0.1) - Microsoft.AspNetCore.Metadata (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) + Microsoft.AspNetCore.Authorization (10.0) + Microsoft.AspNetCore.Metadata (>= 10.0) + Microsoft.Extensions.Diagnostics (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) Microsoft.AspNetCore.Authorization.Policy (2.3) Microsoft.AspNetCore.Authentication.Abstractions (>= 2.3) Microsoft.AspNetCore.Authorization (>= 2.3) - Microsoft.AspNetCore.Connections.Abstractions (9.0.1) - Microsoft.Extensions.Features (>= 9.0.1) + Microsoft.AspNetCore.Connections.Abstractions (10.0) + Microsoft.Extensions.Features (>= 10.0) Microsoft.AspNetCore.Cors (2.3) Microsoft.AspNetCore.Http.Extensions (>= 2.3) Microsoft.Extensions.Configuration.Abstractions (>= 8.0) Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2) Microsoft.Extensions.Logging.Abstractions (>= 8.0.2) Microsoft.Extensions.Options (>= 8.0.2) - Microsoft.AspNetCore.Cryptography.Internal (9.0.1) - Microsoft.AspNetCore.DataProtection (9.0.1) - Microsoft.AspNetCore.Cryptography.Internal (>= 9.0.1) - Microsoft.AspNetCore.DataProtection.Abstractions (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Hosting.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - System.Security.Cryptography.Xml (>= 9.0.1) - Microsoft.AspNetCore.DataProtection.Abstractions (9.0.1) + Microsoft.AspNetCore.Cryptography.Internal (10.0) + Microsoft.AspNetCore.DataProtection (10.0) + Microsoft.AspNetCore.Cryptography.Internal (>= 10.0) + Microsoft.AspNetCore.DataProtection.Abstractions (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Hosting.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + System.Security.Cryptography.Xml (>= 10.0) + Microsoft.AspNetCore.DataProtection.Abstractions (10.0) Microsoft.AspNetCore.Diagnostics (2.3) Microsoft.AspNetCore.Diagnostics.Abstractions (>= 2.3) Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3) @@ -168,7 +170,7 @@ NUGET Microsoft.AspNetCore.Http.Features (5.0.17) Microsoft.Extensions.Primitives (>= 5.0.1) System.IO.Pipelines (>= 5.0.2) - Microsoft.AspNetCore.HttpOverrides (2.3) + Microsoft.AspNetCore.HttpOverrides (2.3.7) Microsoft.AspNetCore.Http.Extensions (>= 2.3) Microsoft.Extensions.Logging.Abstractions (>= 8.0.2) Microsoft.Extensions.Options (>= 8.0.2) @@ -178,15 +180,14 @@ NUGET Microsoft.AspNetCore.Http.Extensions (>= 2.3) Microsoft.Extensions.Configuration.Binder (>= 8.0.2) Microsoft.Extensions.Options (>= 8.0.2) - Microsoft.AspNetCore.JsonPatch (9.0.1) - Microsoft.CSharp (>= 4.7) + Microsoft.AspNetCore.JsonPatch (10.0) Newtonsoft.Json (>= 13.0.3) Microsoft.AspNetCore.Localization (2.3) Microsoft.AspNetCore.Http.Extensions (>= 2.3) Microsoft.Extensions.Localization.Abstractions (>= 8.0.11) Microsoft.Extensions.Logging.Abstractions (>= 8.0.2) Microsoft.Extensions.Options (>= 8.0.2) - Microsoft.AspNetCore.Metadata (9.0.1) + Microsoft.AspNetCore.Metadata (10.0) Microsoft.AspNetCore.Mvc (2.3) Microsoft.AspNetCore.Mvc.ApiExplorer (>= 2.3) Microsoft.AspNetCore.Mvc.Cors (>= 2.3) @@ -302,7 +303,7 @@ NUGET Microsoft.AspNetCore.Server.Kestrel.Https (>= 2.3) Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (>= 2.3) System.IO.Pipelines (>= 8.0) - Microsoft.AspNetCore.Server.Kestrel.Core (2.3) + Microsoft.AspNetCore.Server.Kestrel.Core (2.3.6) Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3) Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.3) Microsoft.AspNetCore.WebUtilities (>= 2.3) @@ -326,235 +327,251 @@ NUGET Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3) Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions (>= 2.3) Microsoft.Extensions.Options (>= 8.0.2) - Microsoft.AspNetCore.WebUtilities (9.0.1) - Microsoft.Net.Http.Headers (>= 9.0.1) - Microsoft.CodeAnalysis.Analyzers (3.11) - Microsoft.CodeAnalysis.Common (4.12) - Microsoft.CodeAnalysis.Analyzers (>= 3.3.4) - System.Collections.Immutable (>= 8.0) - System.Reflection.Metadata (>= 8.0) - Microsoft.CodeAnalysis.CSharp (4.12) - Microsoft.CodeAnalysis.Analyzers (>= 3.3.4) - Microsoft.CodeAnalysis.Common (4.12) - System.Collections.Immutable (>= 8.0) - System.Reflection.Metadata (>= 8.0) + Microsoft.AspNetCore.WebUtilities (10.0) + Microsoft.Net.Http.Headers (>= 10.0) + Microsoft.CodeAnalysis.Analyzers (4.14) + Microsoft.CodeAnalysis.Common (4.14) + Microsoft.CodeAnalysis.Analyzers (>= 3.11) + System.Collections.Immutable (>= 9.0) + System.Reflection.Metadata (>= 9.0) + Microsoft.CodeAnalysis.CSharp (4.14) + Microsoft.CodeAnalysis.Analyzers (>= 3.11) + Microsoft.CodeAnalysis.Common (4.14) + System.Collections.Immutable (>= 9.0) + System.Reflection.Metadata (>= 9.0) Microsoft.CodeAnalysis.Razor (6.0.36) Microsoft.AspNetCore.Razor.Language (>= 6.0.36) Microsoft.CodeAnalysis.Common (>= 4.0) Microsoft.CodeAnalysis.CSharp (>= 4.0) - Microsoft.CSharp (4.7) - Microsoft.Extensions.ApiDescription.Server (9.0.1) - Microsoft.Extensions.Caching.Abstractions (9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Caching.Memory (9.0.1) - Microsoft.Extensions.Caching.Abstractions (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Configuration (9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Configuration.Binder (9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.CommandLine (9.0.1) - Microsoft.Extensions.Configuration (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.EnvironmentVariables (9.0.1) - Microsoft.Extensions.Configuration (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.FileExtensions (9.0.1) - Microsoft.Extensions.Configuration (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.FileProviders.Physical (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Configuration.Json (9.0.1) - Microsoft.Extensions.Configuration (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.UserSecrets (9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.Json (>= 9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.FileProviders.Physical (>= 9.0.1) - Microsoft.Extensions.DependencyInjection (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (9.0.1) - Microsoft.Extensions.DependencyModel (9.0.1) - Microsoft.Extensions.Diagnostics.Abstractions (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Features (9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.FileProviders.Composite (9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.FileProviders.Physical (9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.FileSystemGlobbing (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.FileSystemGlobbing (9.0.1) - Microsoft.Extensions.Hosting.Abstractions (9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Diagnostics.Abstractions (>= 9.0.1) - Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Localization (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Localization.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Localization.Abstractions (9.0.1) - Microsoft.Extensions.Logging (9.0.1) - Microsoft.Extensions.DependencyInjection (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Configuration (9.0.1) - Microsoft.Extensions.Configuration (>= 9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.Binder (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.1) - Microsoft.Extensions.Logging.Console (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging.Configuration (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Logging.Debug (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Logging (>= 9.0.1) - Microsoft.Extensions.Logging.Abstractions (>= 9.0.1) - Microsoft.Extensions.ObjectPool (9.0.1) - Microsoft.Extensions.Options (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Options.ConfigurationExtensions (9.0.1) - Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1) - Microsoft.Extensions.Configuration.Binder (>= 9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.Extensions.Primitives (9.0.1) - Microsoft.Extensions.WebEncoders (9.0.1) - Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1) - Microsoft.Extensions.Options (>= 9.0.1) - Microsoft.Net.Http.Headers (9.0.1) - Microsoft.Extensions.Primitives (>= 9.0.1) - Microsoft.OpenApi (1.6.24) - Newtonsoft.Json (13.0.3) + Microsoft.Extensions.ApiDescription.Server (10.0) + Microsoft.Extensions.Caching.Abstractions (10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Caching.Memory (10.0) + Microsoft.Extensions.Caching.Abstractions (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Configuration (10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Configuration.Binder (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.CommandLine (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.EnvironmentVariables (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.FileExtensions (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.FileProviders.Physical (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Configuration.Json (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.FileExtensions (>= 10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.UserSecrets (10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.Json (>= 10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.FileProviders.Physical (>= 10.0) + Microsoft.Extensions.DependencyInjection (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (10.0) + Microsoft.Extensions.DependencyModel (10.0) + Microsoft.Extensions.Diagnostics (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Diagnostics.Abstractions (>= 10.0) + Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0) + Microsoft.Extensions.Diagnostics.Abstractions (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Features (10.0) + Microsoft.Extensions.FileProviders.Abstractions (10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.FileProviders.Composite (10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.FileProviders.Physical (10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.FileSystemGlobbing (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.FileSystemGlobbing (10.0) + Microsoft.Extensions.Hosting.Abstractions (10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Diagnostics.Abstractions (>= 10.0) + Microsoft.Extensions.FileProviders.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Localization (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Localization.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Localization.Abstractions (10.0) + Microsoft.Extensions.Logging (10.0) + Microsoft.Extensions.DependencyInjection (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Configuration (10.0) + Microsoft.Extensions.Configuration (>= 10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.Binder (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Logging (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0) + Microsoft.Extensions.Logging.Console (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Logging (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.Logging.Configuration (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Logging.Debug (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Logging (>= 10.0) + Microsoft.Extensions.Logging.Abstractions (>= 10.0) + Microsoft.Extensions.ObjectPool (10.0) + Microsoft.Extensions.Options (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Options.ConfigurationExtensions (10.0) + Microsoft.Extensions.Configuration.Abstractions (>= 10.0) + Microsoft.Extensions.Configuration.Binder (>= 10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.Extensions.Primitives (10.0) + Microsoft.Extensions.WebEncoders (10.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0) + Microsoft.Extensions.Options (>= 10.0) + Microsoft.Net.Http.Headers (10.0) + Microsoft.Extensions.Primitives (>= 10.0) + Microsoft.OpenApi (2.3.9) + System.Text.Json (>= 8.0.5) + Newtonsoft.Json (13.0.4) Newtonsoft.Json.Bson (1.0.3) Newtonsoft.Json (>= 13.0.1) - Swashbuckle.AspNetCore (7.2) - Microsoft.Extensions.ApiDescription.Server (>= 6.0.5) - Swashbuckle.AspNetCore.Swagger (>= 7.2) - Swashbuckle.AspNetCore.SwaggerGen (>= 7.2) - Swashbuckle.AspNetCore.SwaggerUI (>= 7.2) - Swashbuckle.AspNetCore.Swagger (7.2) - Microsoft.OpenApi (>= 1.6.22) - Swashbuckle.AspNetCore.SwaggerGen (7.2) - Swashbuckle.AspNetCore.Swagger (>= 7.2) - Swashbuckle.AspNetCore.SwaggerUI (7.2) - System.Buffers (4.6) - System.Collections.Immutable (9.0.1) + Swashbuckle.AspNetCore (10.0.1) + Microsoft.Extensions.ApiDescription.Server (>= 10.0) + Swashbuckle.AspNetCore.Swagger (>= 10.0.1) + Swashbuckle.AspNetCore.SwaggerGen (>= 10.0.1) + Swashbuckle.AspNetCore.SwaggerUI (>= 10.0.1) + Swashbuckle.AspNetCore.Swagger (10.0.1) + Microsoft.OpenApi (>= 2.3) + Swashbuckle.AspNetCore.SwaggerGen (10.0.1) + Swashbuckle.AspNetCore.Swagger (>= 10.0.1) + Swashbuckle.AspNetCore.SwaggerUI (10.0.1) + System.Buffers (4.6.1) + System.Collections.Immutable (10.0) System.ComponentModel.Annotations (5.0) - System.Diagnostics.DiagnosticSource (9.0.1) - System.Formats.Asn1 (9.0.1) - System.IO.Pipelines (9.0.1) - System.Memory (4.6) - System.Numerics.Vectors (4.6) - System.Reflection.Metadata (9.0.1) - System.Runtime.CompilerServices.Unsafe (6.1) + System.Diagnostics.DiagnosticSource (10.0) + System.Formats.Asn1 (10.0) + System.IO.Pipelines (10.0) + System.Memory (4.6.3) + System.Numerics.Vectors (4.6.1) + System.Reflection.Metadata (10.0) + System.Runtime.CompilerServices.Unsafe (6.1.2) System.Security.Cryptography.Cng (5.0) System.Formats.Asn1 (>= 5.0) - System.Security.Cryptography.Pkcs (9.0.1) - System.Security.Cryptography.Xml (9.0.1) - System.Security.Cryptography.Pkcs (>= 9.0.1) + System.Security.Cryptography.Pkcs (10.0) + System.Security.Cryptography.Xml (10.0) + System.Security.Cryptography.Pkcs (>= 10.0) System.Security.Principal.Windows (5.0) - System.Text.Encodings.Web (9.0.1) - System.Text.Json (9.0.1) - System.Threading.Tasks.Extensions (4.6) + System.Text.Encodings.Web (10.0) + System.Text.Json (10.0) + System.Threading.Tasks.Extensions (4.6.3) GROUP Test -RESTRICTION: == net9.0 +RESTRICTION: == net10.0 NUGET remote: https://api.nuget.org/v3/index.json - FSharp.Compiler.Service (43.9.101) - FSharp.Core (9.0.101) - System.Buffers (>= 4.5.1) - System.Collections.Immutable (>= 8.0) - System.Diagnostics.DiagnosticSource (>= 8.0) - System.Memory (>= 4.5.5) + FSharp.Compiler.Service (43.10.100) + FSharp.Core (10.0.100) + System.Buffers (>= 4.6) + System.Collections.Immutable (>= 9.0) + System.Diagnostics.DiagnosticSource (>= 9.0) + System.Memory (>= 4.6) System.Reflection.Emit (>= 4.7) - System.Reflection.Metadata (>= 8.0) - System.Runtime.CompilerServices.Unsafe (>= 6.0) - FSharp.Core (9.0.101) - FSharp.SystemTextJson (1.3.13) + System.Reflection.Metadata (>= 9.0) + System.Runtime.CompilerServices.Unsafe (>= 6.1) + FSharp.Core (10.0.100) + FSharp.SystemTextJson (1.4.36) FSharp.Core (>= 4.7) - System.Text.Json (>= 6.0) - FsUnit.xUnit (7.0.1) + System.Text.Json (>= 6.0.10) + FsUnit.xUnit (7.1.1) FSharp.Core (>= 5.0.2) NHamcrest (>= 4.0) xunit.v3 (>= 1.0) - Microsoft.Bcl.AsyncInterfaces (9.0.1) - Microsoft.CodeCoverage (17.12) - Microsoft.NET.Test.Sdk (17.12) - Microsoft.CodeCoverage (>= 17.12) - Microsoft.TestPlatform.TestHost (>= 17.12) - Microsoft.OpenApi (1.6.24) - redirects: force - Microsoft.OpenApi.Readers (1.6.24) - redirects: force - Microsoft.OpenApi (>= 1.6.24) - SharpYaml (>= 2.1.1) - Microsoft.Testing.Extensions.TrxReport.Abstractions (1.5.1) - Microsoft.Testing.Platform (>= 1.5.1) - Microsoft.Testing.Platform (1.5.1) - Microsoft.Testing.Platform.MSBuild (1.5.1) - Microsoft.Testing.Platform (>= 1.5.1) - Microsoft.TestPlatform.ObjectModel (17.12) - System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.12) - Microsoft.TestPlatform.ObjectModel (>= 17.12) - Newtonsoft.Json (>= 13.0.1) - Newtonsoft.Json (13.0.3) + Microsoft.ApplicationInsights (2.23) + System.Diagnostics.DiagnosticSource (>= 5.0) + Microsoft.Bcl.AsyncInterfaces (10.0) + Microsoft.CodeCoverage (18.0.1) + Microsoft.NET.Test.Sdk (18.0.1) + Microsoft.CodeCoverage (>= 18.0.1) + Microsoft.TestPlatform.TestHost (>= 18.0.1) + Microsoft.OpenApi (2.3.9) + System.Text.Json (>= 8.0.5) + Microsoft.Testing.Extensions.Telemetry (2.0.2) + Microsoft.ApplicationInsights (>= 2.23) + Microsoft.Testing.Platform (>= 2.0.2) + Microsoft.Testing.Extensions.TrxReport.Abstractions (2.0.2) + Microsoft.Testing.Platform (>= 2.0.2) + Microsoft.Testing.Platform (2.0.2) + Microsoft.Testing.Platform.MSBuild (2.0.2) + Microsoft.Testing.Platform (>= 2.0.2) + Microsoft.TestPlatform.ObjectModel (18.0.1) + System.Reflection.Metadata (>= 8.0) + Microsoft.TestPlatform.TestHost (18.0.1) + Microsoft.TestPlatform.ObjectModel (>= 18.0.1) + Newtonsoft.Json (>= 13.0.3) + Microsoft.Win32.Registry (5.0) + System.Security.AccessControl (>= 5.0) + System.Security.Principal.Windows (>= 5.0) + Newtonsoft.Json (13.0.4) NHamcrest (4.0) - SharpYaml (2.1.1) - redirects: force - System.Buffers (4.6) - System.Collections.Immutable (9.0.1) - System.Diagnostics.DiagnosticSource (9.0.1) - System.Memory (4.6) + System.Buffers (4.6.1) + System.Collections.Immutable (10.0) + System.Diagnostics.DiagnosticSource (10.0) + System.Memory (4.6.3) System.Reflection.Emit (4.7) - System.Reflection.Metadata (9.0.1) - System.Runtime.CompilerServices.Unsafe (6.1) - System.Text.Json (9.0.1) - xunit.analyzers (1.19) - xunit.v3 (1.0.1) - xunit.analyzers (>= 1.19) - xunit.v3.assert (1.0.1) - xunit.v3.core (1.0.1) - xunit.v3.assert (1.0.1) - xunit.v3.common (1.0.1) + System.Reflection.Metadata (10.0) + System.Runtime.CompilerServices.Unsafe (6.1.2) + System.Security.AccessControl (6.0.1) + System.Security.Principal.Windows (5.0) + System.Text.Json (10.0) + xunit.analyzers (1.25) + xunit.v3 (3.2) + xunit.v3.mtp-v1 (3.2) + xunit.v3.assert (3.2) + xunit.v3.common (3.2) Microsoft.Bcl.AsyncInterfaces (>= 6.0) - xunit.v3.core (1.0.1) - Microsoft.Testing.Platform.MSBuild (>= 1.5) - xunit.v3.extensibility.core (1.0.1) - xunit.v3.runner.inproc.console (1.0.1) - xunit.v3.extensibility.core (1.0.1) - xunit.v3.common (1.0.1) - xunit.v3.runner.common (1.0.1) - xunit.v3.common (1.0.1) - xunit.v3.runner.inproc.console (1.0.1) - Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 1.5) - Microsoft.Testing.Platform (>= 1.5) - xunit.v3.extensibility.core (1.0.1) - xunit.v3.runner.common (1.0.1) + xunit.v3.core.mtp-v1 (3.2) + Microsoft.Testing.Extensions.Telemetry (>= 1.9) + Microsoft.Testing.Extensions.TrxReport.Abstractions (>= 1.9) + Microsoft.Testing.Platform (>= 1.9) + Microsoft.Testing.Platform.MSBuild (>= 1.9) + xunit.v3.extensibility.core (3.2) + xunit.v3.runner.inproc.console (3.2) + xunit.v3.extensibility.core (3.2) + xunit.v3.common (3.2) + xunit.v3.mtp-v1 (3.2) + xunit.analyzers (>= 1.25) + xunit.v3.assert (3.2) + xunit.v3.core.mtp-v1 (3.2) + xunit.v3.runner.common (3.2) + Microsoft.Win32.Registry (5.0) + xunit.v3.common (3.2) + xunit.v3.runner.inproc.console (3.2) + xunit.v3.extensibility.core (3.2) + xunit.v3.runner.common (3.2) diff --git a/src/Common/AssemblyInfo.fs b/src/Common/AssemblyInfo.fs index 20c9aee..e50c7c7 100644 --- a/src/Common/AssemblyInfo.fs +++ b/src/Common/AssemblyInfo.fs @@ -5,13 +5,13 @@ open System.Reflection [] [] [] -[] -[] +[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "SwaggerProvider" let [] AssemblyProduct = "SwaggerProvider" let [] AssemblyDescription = "F# Type Provider for Swagger & Open API" - let [] AssemblyVersion = "2.3.2" - let [] AssemblyFileVersion = "2.3.2" + let [] AssemblyVersion = "3.0.0" + let [] AssemblyFileVersion = "3.0.0" diff --git a/src/SwaggerProvider.DesignTime/Provider.OpenApiClient.fs b/src/SwaggerProvider.DesignTime/Provider.OpenApiClient.fs index bf08144..c0f93cd 100644 --- a/src/SwaggerProvider.DesignTime/Provider.OpenApiClient.fs +++ b/src/SwaggerProvider.DesignTime/Provider.OpenApiClient.fs @@ -2,6 +2,7 @@ namespace SwaggerProvider open System open System.Reflection +open Microsoft.OpenApi.Reader open ProviderImplementation.ProvidedTypes open Microsoft.FSharp.Core.CompilerServices open Swagger @@ -68,9 +69,13 @@ type public OpenApiClientTypeProvider(cfg: TypeProviderConfig) as this = SchemaReader.readSchemaPath (not ssrfProtection) "" cfg.ResolutionFolder schemaPathRaw |> Async.RunSynchronously - let openApiReader = Microsoft.OpenApi.Readers.OpenApiStringReader() + let settings = OpenApiReaderSettings() + settings.AddYamlReader() - let (schema, diagnostic) = openApiReader.Read(schemaData) + let readResult = + Microsoft.OpenApi.OpenApiDocument.Parse(schemaData, settings = settings) + + let schema, diagnostic = (readResult.Document, readResult.Diagnostic) if diagnostic.Errors.Count > 0 then failwithf diff --git a/src/SwaggerProvider.DesignTime/SwaggerProvider.DesignTime.fsproj b/src/SwaggerProvider.DesignTime/SwaggerProvider.DesignTime.fsproj index 3f8b70c..f37f165 100644 --- a/src/SwaggerProvider.DesignTime/SwaggerProvider.DesignTime.fsproj +++ b/src/SwaggerProvider.DesignTime/SwaggerProvider.DesignTime.fsproj @@ -2,7 +2,7 @@ Library - netstandard2.0;net8.0 + netstandard2.0;net10.0 true true true @@ -53,7 +53,7 @@ - + runtime;contentFiles diff --git a/src/SwaggerProvider.DesignTime/paket.references b/src/SwaggerProvider.DesignTime/paket.references index 2b83f2e..e380a4f 100644 --- a/src/SwaggerProvider.DesignTime/paket.references +++ b/src/SwaggerProvider.DesignTime/paket.references @@ -2,8 +2,8 @@ File: ProvidedTypes.fsi File: ProvidedTypes.fs File: Pluralizer.fs File: NameUtils.fs - System.Text.Json -Microsoft.OpenApi.Readers +Microsoft.OpenApi +Microsoft.OpenApi.YamlReader YamlDotNet diff --git a/src/SwaggerProvider.DesignTime/v2/OperationCompiler.fs b/src/SwaggerProvider.DesignTime/v2/OperationCompiler.fs index e319708..01a73f0 100644 --- a/src/SwaggerProvider.DesignTime/v2/OperationCompiler.fs +++ b/src/SwaggerProvider.DesignTime/v2/OperationCompiler.fs @@ -32,7 +32,7 @@ type OperationCompiler(schema: SwaggerObject, defCompiler: DefinitionCompiler, i else Set.add name existing, name - let required, optional = op.Parameters |> Array.partition(fun x -> x.Required) + let required, optional = op.Parameters |> Array.partition(_.Required) Array.append required optional |> Array.fold diff --git a/src/SwaggerProvider.DesignTime/v2/Parser/Parsers.fs b/src/SwaggerProvider.DesignTime/v2/Parser/Parsers.fs index ec4abc2..5ade60b 100644 --- a/src/SwaggerProvider.DesignTime/v2/Parser/Parsers.fs +++ b/src/SwaggerProvider.DesignTime/v2/Parser/Parsers.fs @@ -61,7 +61,7 @@ type SchemaNode() = /// Gets the string array for the property if it exists. Empty array otherwise. member this.GetStringArraySafe(propertyName) = match this.TryGetProperty(propertyName) with - | Some(value) -> value.AsArray() |> Array.map(fun x -> x.AsString()) + | Some(value) -> value.AsArray() |> Array.map(_.AsString()) | None -> [||] module Parsers = @@ -138,11 +138,11 @@ module Parsers = let (|IsEnum|_|)(obj: SchemaNode) = // Parse `enum` - http://json-schema.org/latest/json-schema-validation.html#anchor76 obj.TryGetProperty("enum") - |> Option.map(fun cases -> cases.AsArray() |> Array.map(fun x -> x.AsString())) + |> Option.map(fun cases -> cases.AsArray() |> Array.map(_.AsString())) let (|IsRef|_|)(obj: SchemaNode) = obj.TryGetProperty("$ref") // Parse `$refs` - |> Option.map(fun ref -> ref.AsString()) + |> Option.map(_.AsString()) let (|IsArray|_|)(obj: SchemaNode) = // Parse Arrays - http://json-schema.org/latest/json-schema-validation.html#anchor36 @@ -182,7 +182,7 @@ module Parsers = let requiredProperties = match obj.TryGetProperty("required") with | None -> Set.empty<_> - | Some(req) -> req.AsArray() |> Array.map(fun x -> x.AsString()) |> Set.ofArray + | Some(req) -> req.AsArray() |> Array.map(_.AsString()) |> Set.ofArray let properties = properties.Properties() @@ -203,7 +203,7 @@ module Parsers = let (|IsAllOf|_|)(obj: SchemaNode) = // Identify composition element 'allOf' - obj.TryGetProperty("allOf") |> Option.map(fun x -> x.AsArray()) + obj.TryGetProperty("allOf") |> Option.map(_.AsArray()) let (|IsComposition|_|)(obj: SchemaNode) = // Models with Object Composition @@ -252,7 +252,7 @@ module Parsers = | IsEnum cases -> let ty = obj.TryGetProperty("type") - |> Option.map(fun x -> x.AsString()) + |> Option.map(_.AsString()) |> Option.defaultValue "string" Enum(cases, ty) diff --git a/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs b/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs index f0bbac3..85c2e9e 100644 --- a/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs +++ b/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs @@ -8,7 +8,7 @@ open FSharp.Data.Runtime.NameUtils open Swagger.Internal open SwaggerProvider.Internal open Microsoft.FSharp.Quotations -open Microsoft.OpenApi.Models +open Microsoft.OpenApi type DefinitionPath = { Namespace: string list @@ -20,10 +20,10 @@ type DefinitionPath = static member Parse(definition: string) = let nsSeparator = '.' - if (not <| definition.StartsWith(DefinitionPath.DefinitionPrefix)) then + if not <| definition.StartsWith DefinitionPath.DefinitionPrefix then failwithf $"Definition path ('%s{definition}') does not start with %s{DefinitionPath.DefinitionPrefix}" - let definitionPath = definition.Substring(DefinitionPath.DefinitionPrefix.Length) + let definitionPath = definition.Substring DefinitionPath.DefinitionPrefix.Length let rec getCharInTypeName ind = if ind = definitionPath.Length then @@ -96,7 +96,7 @@ and NamespaceAbstraction(name: string) = /// Release previously reserved name member _.ReleaseNameReservation tyName = - updateReservation "release the name" tyName (fun () -> providedTys.Remove(tyName) |> ignore) + updateReservation "release the name" tyName (fun () -> providedTys.Remove tyName |> ignore) /// Mark type name as named alias for basic type member _.MarkTypeAsNameAlias tyName = @@ -121,12 +121,12 @@ and NamespaceAbstraction(name: string) = | true, Namespace ns -> ns | true, NestedType(_, ns) -> ns | true, ProvidedType ty -> - let ns = NamespaceAbstraction(name) + let ns = NamespaceAbstraction name providedTys[name] <- NestedType(ty, ns) ns | false, _ | true, Reservation -> - let ns = NamespaceAbstraction(name) + let ns = NamespaceAbstraction name providedTys[name] <- Namespace ns ns | true, value -> failwithf $"Name collision, cannot create namespace '%s{name}' because it used by '%A{value}'" @@ -175,14 +175,14 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = |> Map.ofSeq let pathToType = Collections.Generic.Dictionary<_, Type>() - let nsRoot = NamespaceAbstraction("Root") + let nsRoot = NamespaceAbstraction "Root" let nsOps = nsRoot.GetOrCreateNamespace "OperationTypes" let generateProperty (scope: UniqueNameGenerator) propName ty = let propertyName = scope.MakeUnique <| nicePascalName propName let providedField = - let fieldName = $"_%c{Char.ToLower propertyName[0]}%s{propertyName.Substring(1)}" + let fieldName = $"_%c{Char.ToLower propertyName[0]}%s{propertyName.Substring 1}" ProvidedField(fieldName, ty) @@ -225,13 +225,19 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = let ns, tyName = tyPath |> DefinitionPath.Parse |> nsRoot.Resolve let ty = compileBySchema ns tyName def true (registerInNsAndInDef tyPath ns) true ty :> Type - | None when tyPath.StartsWith(DefinitionPath.DefinitionPrefix) -> + | None when tyPath.StartsWith DefinitionPath.DefinitionPrefix -> failwithf $"Cannot find definition '%s{tyPath}' in schema definitions %A{pathToType.Keys |> Seq.toArray}" | None -> failwithf $"Cannot find definition '%s{tyPath}' (references to relative documents are not supported yet)" - and compileBySchema (ns: NamespaceAbstraction) tyName (schemaObj: OpenApiSchema) isRequired registerNew fromByPathCompiler = + and compileBySchema (ns: NamespaceAbstraction) tyName (schemaObj: IOpenApiSchema) isRequired registerNew fromByPathCompiler = let compileNewObject() = - if schemaObj.Properties.Count = 0 && schemaObj.AllOf.Count = 0 then + let inline toSeq x = + if isNull x then Seq.empty else x :> seq<_> + + let properties = schemaObj.Properties |> toSeq + let allOf = schemaObj.AllOf |> toSeq + + if Seq.isEmpty properties && Seq.isEmpty allOf then if not <| isNull tyName then ns.MarkTypeAsNameAlias tyName @@ -245,22 +251,22 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = // Combine composite schemas let schemaObjProperties = - match schemaObj.AllOf.Count > 0 with - | true -> - schemaObj.AllOf - |> Seq.append [ schemaObj ] - |> Seq.collect(fun x -> x.Properties) - | false -> schemaObj.Properties + let getProps(s: IOpenApiSchema) = + s.Properties |> toSeq + + match Seq.isEmpty allOf with + | false -> allOf |> Seq.append [ schemaObj ] |> Seq.collect getProps + | true -> getProps schemaObj + let schemaObjRequired = - match schemaObj.AllOf.Count > 0 with - | true -> - schemaObj.AllOf - |> Seq.append [ schemaObj ] - |> Seq.collect(fun x -> x.Required) - |> System.Collections.Generic.HashSet - :> System.Collections.Generic.ISet - | false -> schemaObj.Required + let getReq(s: IOpenApiSchema) = + s.Required |> toSeq + + match Seq.isEmpty allOf with + | false -> allOf |> Seq.append [ schemaObj ] |> Seq.collect getReq + | true -> getReq schemaObj + |> Set.ofSeq // Generate fields and properties let members = @@ -270,10 +276,10 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = |> List.map(fun p -> let propName, propSchema = p.Key, p.Value - if String.IsNullOrEmpty(propName) then + if String.IsNullOrEmpty propName then failwithf $"Property cannot be created with empty name. TypeName:%A{tyName}; SchemaObj:%A{schemaObj}" - let isRequired = schemaObjRequired.Contains(propName) + let isRequired = schemaObjRequired.Contains propName let pTy = compileBySchema ns (ns.ReserveUniqueName tyName (nicePascalName propName)) propSchema isRequired ns.RegisterType false @@ -297,14 +303,14 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = let ctorParams, fields = let required, optional = List.zip (List.ofSeq schemaObjProperties) members - |> List.partition(fun (x, _) -> schemaObjRequired.Contains(x.Key)) + |> List.partition(fun (x, _) -> schemaObjRequired.Contains x.Key) - (required @ optional) + required @ optional |> List.map(fun (x, (f, p)) -> let paramName = niceCamelName p.Name let prParam = - if schemaObjRequired.Contains(x.Key) then + if schemaObjRequired.Contains x.Key then ProvidedParameter(paramName, f.FieldType) else let paramDefaultValue = this.GetDefaultValue f.FieldType @@ -320,7 +326,7 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = fun args -> let this, args = match args with - | x :: xs -> (x, xs) + | x :: xs -> x, xs | _ -> failwith "Wrong constructor arguments" List.zip args fields @@ -350,7 +356,7 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = let pValuesArr = Expr.NewArray(typeof, List.ofArray pValues) <@@ - let values = (%%pValuesArr: array) + let values = %%pValuesArr: array let rec formatValue(v: obj) = if isNull v then @@ -382,25 +388,40 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = ty :> Type + let resolvedType = + // If schemaObj.Type is missing, but allOf is present and first allOf subschema has a type, use that + if + not schemaObj.Type.HasValue + && not(isNull schemaObj.AllOf) + && schemaObj.AllOf.Count > 0 + then + let firstAllOf = schemaObj.AllOf.[0] + + if not(isNull firstAllOf) && firstAllOf.Type.HasValue then + Some firstAllOf.Type.Value + else + None + else if schemaObj.Type.HasValue then + Some schemaObj.Type.Value + else + None + let tyType = match schemaObj with | null -> failwithf $"Cannot compile object '%s{tyName}' when schema is 'null'" - | _ when - (not(isNull schemaObj.Reference)) - && not <| schemaObj.Reference.Id.EndsWith(tyName) - -> + | :? OpenApiSchemaReference as schemaRef when not <| schemaRef.Reference.Id.EndsWith tyName -> ns.ReleaseNameReservation tyName - compileByPath <| schemaObj.Reference.ReferenceV3 - | _ when schemaObj.UnresolvedReference -> - match pathToType.TryGetValue schemaObj.Reference.ReferenceV3 with + compileByPath <| schemaRef.Reference.Id + | :? OpenApiSchemaReference as schemaRef -> + match pathToType.TryGetValue schemaRef.Reference.Id with | true, ty -> ns.ReleaseNameReservation tyName ty - | _ -> failwithf $"Cannot compile object '%s{tyName}' based on unresolved reference '{schemaObj.Reference.ReferenceV3}'" + | _ -> failwithf $"Cannot compile object '%s{tyName}' based on unresolved reference '{schemaRef.Reference.Id}'" // TODO: fail on external references //| _ when schemaObj.Reference <> null && tyName <> schemaObj.Reference.Id -> | _ when - schemaObj.Type = "object" + resolvedType = Some JsonSchemaType.Object && not(isNull schemaObj.AdditionalProperties) -> // Dictionary -> ns.ReleaseNameReservation tyName @@ -410,34 +431,40 @@ type DefinitionCompiler(schema: OpenApiDocument, provideNullable) as this = compileBySchema ns (ns.ReserveUniqueName tyName "Item") elSchema true ns.RegisterType false ProvidedTypeBuilder.MakeGenericType(typedefof>, [ typeof; elTy ]) - | _ when isNull schemaObj.Type || schemaObj.Type = "object" -> // Object props -> - compileNewObject() + | _ when resolvedType.IsNone || resolvedType = Some JsonSchemaType.Object -> compileNewObject() | _ -> ns.MarkTypeAsNameAlias tyName - match schemaObj.Type, schemaObj.Format with - | "integer", "int64" -> typeof - | "integer", _ -> typeof - | "number", "double" -> typeof - | "number", _ -> typeof - | "boolean", _ -> typeof - | "string", "byte" -> typeof.MakeArrayType 1 - | "string", "binary" // for `application/octet-stream` request body - | "file", _ -> // for `multipart/form-data` : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#considerations-for-file-uploads - typeof - | "string", "date" - | "string", "date-time" -> typeof - | "string", "uuid" -> typeof - | "string", _ -> typeof - | "array", _ -> - ns.ReleaseNameReservation tyName - let elSchema = schemaObj.Items - - let elTy = - compileBySchema ns (ns.ReserveUniqueName tyName "Item") elSchema true ns.RegisterType false - - elTy.MakeArrayType(1) - | ty, format -> failwithf $"Type %s{tyName}(%s{ty},%s{format}) should be caught by other match statement (%A{schemaObj.Type})" + match resolvedType with + | None -> failwithf $"Schema type is not specified for '%s{tyName}'" + | Some t -> + let (|HasFlag|_|) (flag: JsonSchemaType) (value: JsonSchemaType) = + if value.HasFlag flag then Some() else None + + match t, schemaObj.Format with + | HasFlag JsonSchemaType.Boolean, _ -> typeof + | HasFlag JsonSchemaType.Integer, "int64" -> typeof + | HasFlag JsonSchemaType.Integer, _ -> typeof + | HasFlag JsonSchemaType.Number, "double" -> typeof + | HasFlag JsonSchemaType.Number, _ -> typeof + | HasFlag JsonSchemaType.String, "byte" -> typeof.MakeArrayType 1 + | HasFlag JsonSchemaType.String, "binary" -> + // for `application/octet-stream` request body + // for `multipart/form-data` : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#considerations-for-file-uploads + typeof + | HasFlag JsonSchemaType.String, "date" + | HasFlag JsonSchemaType.String, "date-time" -> typeof + | HasFlag JsonSchemaType.String, "uuid" -> typeof + | HasFlag JsonSchemaType.String, _ -> typeof + | HasFlag JsonSchemaType.Array, _ -> + ns.ReleaseNameReservation tyName + let elSchema = schemaObj.Items + + let elTy = + compileBySchema ns (ns.ReserveUniqueName tyName "Item") elSchema true ns.RegisterType false + + elTy.MakeArrayType 1 + | ty, format -> failwithf $"Type %s{tyName}(%A{ty},%s{format}) should be caught by other match statement (%A{resolvedType})" if fromByPathCompiler then registerNew(tyName, tyType) diff --git a/src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs b/src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs index 0d586c8..6688099 100644 --- a/src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs +++ b/src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs @@ -8,7 +8,7 @@ open System.Text.RegularExpressions open Microsoft.FSharp.Quotations open Microsoft.FSharp.Quotations.ExprShape -open Microsoft.OpenApi.Models +open Microsoft.OpenApi open ProviderImplementation.ProvidedTypes open FSharp.Data.Runtime.NameUtils @@ -19,7 +19,7 @@ open Swagger.Internal // We cannot use record here // TP cannot load DTC with OpenApiPathItem/OperationType props (from 3rd party assembly) // Probably related to https://github.com/fsprojects/FSharp.TypeProviders.SDK/issues/274 -type ApiCall = string * OpenApiPathItem * OperationType +type ApiCall = string * IOpenApiPathItem * HttpMethod [] type PayloadType = @@ -63,14 +63,18 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, if String.IsNullOrWhiteSpace providedMethodName then failwithf $"Operation name could not be empty. See '%s{path}/%A{opTy}'" - let unambiguousName(par: OpenApiParameter) = + let unambiguousName(par: IOpenApiParameter) = $"%s{par.Name}In%A{par.In}" - let openApiParameters = [ yield! pathItem.Parameters; yield! operation.Parameters ] + let openApiParameters = + [ if not(isNull pathItem.Parameters) then + yield! pathItem.Parameters + if not(isNull operation.Parameters) then + yield! operation.Parameters ] let (|MediaType|_|) contentType (content: IDictionary) = match content.TryGetValue contentType with - | true, mediaTyObj -> Some(mediaTyObj) + | true, mediaTyObj -> Some mediaTyObj | _ -> None let (|TextReturn|_|)(input: string) = @@ -85,7 +89,7 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, let payloadMime, parameters = /// handles de-duplicating Swagger parameter names if the same parameter name /// appears in multiple locations in a given operation definition. - let uniqueParamName usedNames (param: OpenApiParameter) = + let uniqueParamName usedNames (param: IOpenApiParameter) = let name = niceCamelName param.Name if usedNames |> Set.contains name then @@ -106,6 +110,7 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, Schema = schema, Required = true //operation.RequestBody.Required ) + :> IOpenApiParameter Some(payloadType, p) @@ -130,7 +135,7 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, if bodyFormatAndParam.IsSome then yield bodyFormatAndParam.Value |> snd ] |> List.distinctBy(fun op -> op.Name, op.In) - |> List.partition(fun x -> x.Required) + |> List.partition(_.Required) List.append required optional @@ -273,7 +278,7 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, let path, queryParams, headers = let path, queryParams, headers, cookies = ((<@ path @>, <@ [] @>, headers, <@ [] @>), parameters) - ||> List.fold(fun (path, query, headers, cookies) (param: OpenApiParameter, valueExpr) -> + ||> List.fold(fun (path, query, headers, cookies) (param: IOpenApiParameter, valueExpr) -> if param.In.HasValue then let name = param.Name @@ -462,12 +467,16 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler, List.ofSeq schema.Paths |> List.collect(fun path -> - if path.Value.UnresolvedReference then - failwith - $"TP does not support unresolved paths / external references. Path '%s{path.Key}' refer to '%s{path.Value.Reference.ReferenceV3}'" + // if path.Value.UnresolvedReference then + // failwith + // $"TP does not support unresolved paths / external references. Path '%s{path.Key}' refer to '%s{path.Value.Reference.ReferenceV3}'" - List.ofSeq path.Value.Operations + let safeSeq s = + if isNull s then Seq.empty else s + + List.ofSeq(safeSeq path.Value.Operations) |> List.map(fun kv -> path.Key, path.Value, kv.Key)) + |> List.groupBy(fun (_, pathItem, opTy) -> if ignoreControllerPrefix then String.Empty // diff --git a/src/SwaggerProvider.Runtime/SwaggerProvider.Runtime.fsproj b/src/SwaggerProvider.Runtime/SwaggerProvider.Runtime.fsproj index 7cabadf..f2d47f9 100644 --- a/src/SwaggerProvider.Runtime/SwaggerProvider.Runtime.fsproj +++ b/src/SwaggerProvider.Runtime/SwaggerProvider.Runtime.fsproj @@ -4,7 +4,7 @@ Library - netstandard2.0;net8.0 + netstandard2.0;net10.0 true TP_RUNTIME false diff --git a/src/SwaggerProvider.Runtime/paket.template b/src/SwaggerProvider.Runtime/paket.template index 10658fb..c38e1b0 100644 --- a/src/SwaggerProvider.Runtime/paket.template +++ b/src/SwaggerProvider.Runtime/paket.template @@ -24,9 +24,9 @@ description F# Type Providers for Swagger & OpenAPI files bin/Release/netstandard2.0/SwaggerProvider.Runtime.* ==> lib/netstandard2.0 - bin/Release/net8.0/SwaggerProvider.Runtime.* ==> lib/net8.0 + bin/Release/net10.0/SwaggerProvider.Runtime.* ==> lib/net10.0 bin/Release/typeproviders/fsharp41/netstandard2.0/*.dll ==> typeproviders/fsharp41/netstandard2.0 - bin/Release/typeproviders/fsharp41/net8.0/*.dll ==> typeproviders/fsharp41/net8.0 + bin/Release/typeproviders/fsharp41/net10.0/*.dll ==> typeproviders/fsharp41/net10.0 references SwaggerProvider.Runtime.dll dependencies diff --git a/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj b/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj index 507352a..fe59d9e 100644 --- a/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj +++ b/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 true true diff --git a/tests/SwaggerProvider.Tests/APIs.guru.fs b/tests/SwaggerProvider.Tests/APIs.guru.fs index e528a35..cf2dac5 100644 --- a/tests/SwaggerProvider.Tests/APIs.guru.fs +++ b/tests/SwaggerProvider.Tests/APIs.guru.fs @@ -15,7 +15,7 @@ let private apisGuruList = |> Async.RunSynchronously JsonDocument.Parse(list).RootElement.EnumerateObject() - |> Seq.map(fun x -> x.Value)) + |> Seq.map(_.Value)) let private getApisGuruSchemas propertyName = let getProp (prop: string) (obj: JsonElement) = @@ -30,9 +30,9 @@ let private getApisGuruSchemas propertyName = |> Seq.choose(fun schema -> schema |> getProp "versions" - |> Option.bind(fun v -> v.EnumerateObject() |> Seq.map(fun y -> y.Value) |> Seq.last |> Some)) + |> Option.bind(fun v -> v.EnumerateObject() |> Seq.map(_.Value) |> Seq.last |> Some)) |> Seq.choose(getProp propertyName) - |> Seq.map(fun x -> x.GetString()) + |> Seq.map(_.GetString()) |> Seq.toArray let Schemas = lazy (getApisGuruSchemas "swaggerYamlUrl") // "swaggerUrl" diff --git a/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs b/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs index caff84b..208c8b7 100644 --- a/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs +++ b/tests/SwaggerProvider.Tests/Schema.Parser.Tests.fs @@ -1,5 +1,6 @@ module SwaggerProvider.Tests.v3 +open Microsoft.OpenApi.Reader open Xunit open FsUnitTyped open System @@ -21,9 +22,13 @@ module V3 = open SwaggerProvider.Internal.v3.Compilers let testSchema schemaStr = - let openApiReader = Microsoft.OpenApi.Readers.OpenApiStringReader() + let settings = OpenApiReaderSettings() + settings.AddYamlReader() - let schema, diagnostic = openApiReader.Read(schemaStr) + let readResult = + Microsoft.OpenApi.OpenApiDocument.Parse(schemaStr, settings = settings) + + let schema = readResult.Document (* if diagnostic.Errors.Count > 0 then failwithf "Schema parse errors:\n- %s" (diagnostic.Errors diff --git a/tests/SwaggerProvider.Tests/SwaggerProvider.Tests.fsproj b/tests/SwaggerProvider.Tests/SwaggerProvider.Tests.fsproj index 5b94161..7ed16ec 100644 --- a/tests/SwaggerProvider.Tests/SwaggerProvider.Tests.fsproj +++ b/tests/SwaggerProvider.Tests/SwaggerProvider.Tests.fsproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 true diff --git a/tests/SwaggerProvider.Tests/paket.references b/tests/SwaggerProvider.Tests/paket.references index 399fcde..f1224c9 100755 --- a/tests/SwaggerProvider.Tests/paket.references +++ b/tests/SwaggerProvider.Tests/paket.references @@ -3,5 +3,5 @@ group Test FSharp.SystemTextJson FsUnit.xUnit Microsoft.NET.Test.Sdk - Microsoft.OpenApi.Readers + Microsoft.OpenApi System.Text.Json diff --git a/tests/Swashbuckle.WebApi.Server/Controllers/FileController.fs b/tests/Swashbuckle.WebApi.Server/Controllers/FileController.fs index 529dcc3..59a5f12 100644 --- a/tests/Swashbuckle.WebApi.Server/Controllers/FileController.fs +++ b/tests/Swashbuckle.WebApi.Server/Controllers/FileController.fs @@ -4,10 +4,19 @@ open System open System.IO open Microsoft.AspNetCore.Mvc open Microsoft.AspNetCore.Http -open Microsoft.OpenApi.Models -open Swagger.Internal +open Microsoft.OpenApi open Swashbuckle.AspNetCore.SwaggerGen +module MediaTypes = + + open System.Net.Mime + + [] + let ApplicationOctetStream = MediaTypeNames.Application.Octet + + [] + let ApplicationJson = MediaTypeNames.Application.Json + type FormWithFile() = member val Name: string = "" with get, set member val File: IFormFile = null with get, set @@ -22,11 +31,11 @@ type BinaryContentFilter() = let att = ctx.MethodInfo.GetCustomAttributes(typeof, false) if att.Length > 0 then - op.RequestBody <- OpenApiRequestBody(Required = true) + op.RequestBody <- OpenApiRequestBody(Required = true, Content = System.Collections.Generic.Dictionary()) op.RequestBody.Content.Add( MediaTypes.ApplicationOctetStream, - OpenApiMediaType(Schema = OpenApiSchema(Type = "string", Format = "binary")) + OpenApiMediaType(Schema = OpenApiSchema(Type = JsonSchemaType.String, Format = "binary")) ) [] diff --git a/tests/Swashbuckle.WebApi.Server/Controllers/UpdateControllers.fs b/tests/Swashbuckle.WebApi.Server/Controllers/UpdateControllers.fs index 88d4afd..a5d05e7 100644 --- a/tests/Swashbuckle.WebApi.Server/Controllers/UpdateControllers.fs +++ b/tests/Swashbuckle.WebApi.Server/Controllers/UpdateControllers.fs @@ -37,7 +37,7 @@ type UpdateStringController() = inherit UpdateController((+) "Hello, ") type UpdateDateTimeController() = - inherit UpdateController(fun x -> x.AddDays(1.0)) + inherit UpdateController(_.AddDays(1.0)) type UpdateGuidController() = inherit UpdateController(id) diff --git a/tests/Swashbuckle.WebApi.Server/Startup.fs b/tests/Swashbuckle.WebApi.Server/Startup.fs index 87f55c4..2a98bea 100644 --- a/tests/Swashbuckle.WebApi.Server/Startup.fs +++ b/tests/Swashbuckle.WebApi.Server/Startup.fs @@ -5,7 +5,7 @@ open Microsoft.AspNetCore.Builder open Microsoft.AspNetCore.Hosting open Microsoft.Extensions.Configuration open Microsoft.Extensions.DependencyInjection -open Microsoft.OpenApi.Models +open Microsoft.OpenApi open System.Text.Json.Serialization open Swashbuckle.WebApi.Server.Controllers @@ -26,6 +26,7 @@ type Startup private () = converters.Add(JsonStringEnumConverter())) .AddMvcOptions(_.OutputFormatters.Add(CsvOutputFormatter())) |> ignore + // Register the Swagger & OpenApi services services.AddSwaggerGen(fun c -> c.SwaggerDoc("v1", OpenApiInfo(Title = "My API", Version = "v1")) @@ -41,14 +42,12 @@ type Startup private () = // Register the Swagger generator and the Swagger UI middlewares app.UseSwagger(fun c -> c.RouteTemplate <- "/swagger/{documentName}/swagger.json" - c.SerializeAsV2 <- true // false = v3 = OpenApi - ) + c.OpenApiVersion <- OpenApiSpecVersion.OpenApi2_0) |> ignore app.UseSwagger(fun c -> c.RouteTemplate <- "/swagger/{documentName}/openapi.json" - c.SerializeAsV2 <- false // false = v3 = OpenApi - ) + c.OpenApiVersion <- OpenApiSpecVersion.OpenApi3_0) |> ignore app.UseSwaggerUI(fun c -> diff --git a/tests/Swashbuckle.WebApi.Server/Swashbuckle.WebApi.Server.fsproj b/tests/Swashbuckle.WebApi.Server/Swashbuckle.WebApi.Server.fsproj index b70e960..1aa8f41 100644 --- a/tests/Swashbuckle.WebApi.Server/Swashbuckle.WebApi.Server.fsproj +++ b/tests/Swashbuckle.WebApi.Server/Swashbuckle.WebApi.Server.fsproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 true true Swashbuckle.WebApi.Server