Skip to content

Commit 33f46d6

Browse files
committed
fix: downgrade microsoft.openapi to v2 (supported by aspnet.core .net10)
1 parent d42e4c2 commit 33f46d6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

paket.dependencies

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ storage: none
55
nuget FSharp.Core ~> 8
66
nuget System.Text.Json ~> 8
77
nuget FSharp.SystemTextJson
8-
nuget Microsoft.OpenApi
8+
nuget Microsoft.OpenApi ~> 2 # https://github.com/microsoft/OpenAPI.NET/blob/main/CONTRIBUTING.md#branches-and-support-policy
99
nuget Microsoft.OpenApi.YamlReader
1010
nuget NETStandard.Library.NETFramework
1111

@@ -27,7 +27,7 @@ group Server
2727
nuget Microsoft.AspNetCore.Mvc
2828
nuget Microsoft.AspNetCore.HttpsPolicy
2929
nuget Swashbuckle.AspNetCore
30-
nuget Microsoft.OpenApi
30+
nuget Microsoft.OpenApi ~> 2
3131
nuget FSharp.Core
3232
nuget System.Text.Json
3333

@@ -42,5 +42,5 @@ group Test
4242
nuget Microsoft.NET.Test.Sdk
4343
nuget FsUnit.Xunit
4444

45-
nuget Microsoft.OpenApi
45+
nuget Microsoft.OpenApi ~> 2
4646
nuget FSharp.SystemTextJson

paket.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ NUGET
88
Microsoft.Bcl.AsyncInterfaces (10.0) - restriction: || (>= net462) (&& (< net6.0) (>= netstandard2.0))
99
System.Threading.Tasks.Extensions (>= 4.6.3) - restriction: || (>= net462) (&& (>= netstandard2.0) (< netstandard2.1))
1010
Microsoft.NETCore.Platforms (7.0.4) - restriction: >= net461
11-
Microsoft.OpenApi (3.0)
11+
Microsoft.OpenApi (2.3.9)
1212
System.Text.Json (>= 8.0.5) - restriction: >= netstandard2.0
13-
Microsoft.OpenApi.YamlReader (3.0)
14-
Microsoft.OpenApi (>= 3.0) - restriction: >= netstandard2.0
13+
Microsoft.OpenApi.YamlReader (2.3.9)
14+
Microsoft.OpenApi (>= 2.3.9) - restriction: >= netstandard2.0
1515
SharpYaml (>= 2.1.4) - restriction: >= netstandard2.0
1616
System.Text.Json (>= 8.0.5) - restriction: >= netstandard2.0
1717
NETStandard.Library (2.0.3) - restriction: >= net461
@@ -457,7 +457,7 @@ NUGET
457457
Microsoft.Extensions.Options (>= 10.0)
458458
Microsoft.Net.Http.Headers (10.0)
459459
Microsoft.Extensions.Primitives (>= 10.0)
460-
Microsoft.OpenApi (3.0)
460+
Microsoft.OpenApi (2.3.9)
461461
System.Text.Json (>= 8.0.5)
462462
Newtonsoft.Json (13.0.4)
463463
Newtonsoft.Json.Bson (1.0.3)
@@ -520,7 +520,7 @@ NUGET
520520
Microsoft.NET.Test.Sdk (18.0.1)
521521
Microsoft.CodeCoverage (>= 18.0.1)
522522
Microsoft.TestPlatform.TestHost (>= 18.0.1)
523-
Microsoft.OpenApi (3.0)
523+
Microsoft.OpenApi (2.3.9)
524524
System.Text.Json (>= 8.0.5)
525525
Microsoft.Testing.Extensions.Telemetry (2.0.2)
526526
Microsoft.ApplicationInsights (>= 2.23)

src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ type OperationCompiler(schema: OpenApiDocument, defCompiler: DefinitionCompiler,
7272
if not(isNull operation.Parameters) then
7373
yield! operation.Parameters ]
7474

75-
let (|MediaType|_|) contentType (content: IDictionary<string, IOpenApiMediaType>) =
75+
let (|MediaType|_|) contentType (content: IDictionary<string, OpenApiMediaType>) =
7676
match content.TryGetValue contentType with
7777
| true, mediaTyObj -> Some mediaTyObj
7878
| _ -> None
7979

8080
let (|TextReturn|_|)(input: string) =
8181
if input.StartsWith("text/") then Some(input) else None
8282

83-
let (|TextMediaType|_|)(content: IDictionary<string, IOpenApiMediaType>) =
83+
let (|TextMediaType|_|)(content: IDictionary<string, OpenApiMediaType>) =
8484
content.Keys |> Seq.tryPick (|TextReturn|_|)
8585

86-
let (|NoMediaType|_|)(content: IDictionary<string, IOpenApiMediaType>) =
86+
let (|NoMediaType|_|)(content: IDictionary<string, OpenApiMediaType>) =
8787
if content.Count = 0 then Some() else None
8888

8989
let payloadMime, parameters =

tests/Swashbuckle.WebApi.Server/Controllers/FileController.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type BinaryContentFilter() =
3131
let att = ctx.MethodInfo.GetCustomAttributes(typeof<BinaryContentAttribute>, false)
3232

3333
if att.Length > 0 then
34-
op.RequestBody <- OpenApiRequestBody(Required = true, Content = System.Collections.Generic.Dictionary<string, IOpenApiMediaType>())
34+
op.RequestBody <- OpenApiRequestBody(Required = true, Content = System.Collections.Generic.Dictionary<string, OpenApiMediaType>())
3535

3636
op.RequestBody.Content.Add(
3737
MediaTypes.ApplicationOctetStream,

0 commit comments

Comments
 (0)