diff --git a/global.json b/global.json index d37f8c39..26ffc0f5 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.100-preview.5.25277.114", + "version": "10.0.100-preview.6.25358.103", "allowPrerelease": false, "rollForward": "latestMajor" } diff --git a/src/TodoApp/OpenApi/AspNetCore/AddExamplesTransformer.cs b/src/TodoApp/OpenApi/AspNetCore/AddExamplesTransformer.cs index fa04923f..9af51dbc 100644 --- a/src/TodoApp/OpenApi/AspNetCore/AddExamplesTransformer.cs +++ b/src/TodoApp/OpenApi/AspNetCore/AddExamplesTransformer.cs @@ -2,7 +2,7 @@ // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using Microsoft.AspNetCore.OpenApi; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; namespace TodoApp.OpenApi.AspNetCore; diff --git a/src/TodoApp/OpenApi/AspNetCore/AddSchemaDescriptionsTransformer.cs b/src/TodoApp/OpenApi/AspNetCore/AddSchemaDescriptionsTransformer.cs index 311b8c89..2f111d90 100644 --- a/src/TodoApp/OpenApi/AspNetCore/AddSchemaDescriptionsTransformer.cs +++ b/src/TodoApp/OpenApi/AspNetCore/AddSchemaDescriptionsTransformer.cs @@ -7,7 +7,7 @@ using System.Xml; using System.Xml.XPath; using Microsoft.AspNetCore.OpenApi; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; namespace TodoApp.OpenApi.AspNetCore; diff --git a/src/TodoApp/OpenApi/AspNetCore/AspNetCoreOpenApiEndpoints.cs b/src/TodoApp/OpenApi/AspNetCore/AspNetCoreOpenApiEndpoints.cs index 21a78cbd..4d96422d 100644 --- a/src/TodoApp/OpenApi/AspNetCore/AspNetCoreOpenApiEndpoints.cs +++ b/src/TodoApp/OpenApi/AspNetCore/AspNetCoreOpenApiEndpoints.cs @@ -1,9 +1,7 @@ // Copyright (c) Martin Costello, 2024. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Models.Interfaces; -using Microsoft.OpenApi.Models.References; +using Microsoft.OpenApi; namespace TodoApp.OpenApi.AspNetCore; @@ -50,7 +48,7 @@ public static IServiceCollection AddAspNetCoreOpenApi(this IServiceCollection se var reference = new OpenApiSecuritySchemeReference(referenceId, document); document.Components ??= new(); - document.Components.SecuritySchemes ??= []; + document.Components.SecuritySchemes ??= new Dictionary(); document.Components.SecuritySchemes[referenceId] = scheme; document.Security ??= []; document.Security.Add(new() { [reference] = [] }); diff --git a/src/TodoApp/OpenApi/ExamplesProcessor.cs b/src/TodoApp/OpenApi/ExamplesProcessor.cs index f5ff54bc..aa79d90a 100644 --- a/src/TodoApp/OpenApi/ExamplesProcessor.cs +++ b/src/TodoApp/OpenApi/ExamplesProcessor.cs @@ -5,8 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Models.Interfaces; +using Microsoft.OpenApi; namespace TodoApp.OpenApi; diff --git a/src/TodoApp/OpenApi/Swashbuckle/AddDocumentTagsFilter.cs b/src/TodoApp/OpenApi/Swashbuckle/AddDocumentTagsFilter.cs index 837bd683..87572d3e 100644 --- a/src/TodoApp/OpenApi/Swashbuckle/AddDocumentTagsFilter.cs +++ b/src/TodoApp/OpenApi/Swashbuckle/AddDocumentTagsFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) Martin Costello, 2024. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace TodoApp.OpenApi.Swashbuckle; @@ -13,7 +13,7 @@ public class AddDocumentTagsFilter : IDocumentFilter { public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { - swaggerDoc.Tags ??= []; + swaggerDoc.Tags ??= new HashSet(); swaggerDoc.Tags.Add(new() { Name = "TodoApp" }); } } diff --git a/src/TodoApp/OpenApi/Swashbuckle/AddServersFilter.cs b/src/TodoApp/OpenApi/Swashbuckle/AddServersFilter.cs index 52cb2748..f124f2af 100644 --- a/src/TodoApp/OpenApi/Swashbuckle/AddServersFilter.cs +++ b/src/TodoApp/OpenApi/Swashbuckle/AddServersFilter.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace TodoApp.OpenApi.Swashbuckle; diff --git a/src/TodoApp/OpenApi/Swashbuckle/ExampleFilter.cs b/src/TodoApp/OpenApi/Swashbuckle/ExampleFilter.cs index 59b007b3..281899eb 100644 --- a/src/TodoApp/OpenApi/Swashbuckle/ExampleFilter.cs +++ b/src/TodoApp/OpenApi/Swashbuckle/ExampleFilter.cs @@ -1,8 +1,7 @@ // Copyright (c) Martin Costello, 2024. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Models.Interfaces; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace TodoApp.OpenApi.Swashbuckle; diff --git a/src/TodoApp/OpenApi/Swashbuckle/SwashbuckleOpenApiEndpoints.cs b/src/TodoApp/OpenApi/Swashbuckle/SwashbuckleOpenApiEndpoints.cs index 2bdc674a..72b8de2d 100644 --- a/src/TodoApp/OpenApi/Swashbuckle/SwashbuckleOpenApiEndpoints.cs +++ b/src/TodoApp/OpenApi/Swashbuckle/SwashbuckleOpenApiEndpoints.cs @@ -1,8 +1,7 @@ // Copyright (c) Martin Costello, 2024. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Models.References; +using Microsoft.OpenApi; namespace TodoApp.OpenApi.Swashbuckle; diff --git a/src/TodoApp/TodoApp.csproj b/src/TodoApp/TodoApp.csproj index 09ccf0d5..437abaaf 100644 --- a/src/TodoApp/TodoApp.csproj +++ b/src/TodoApp/TodoApp.csproj @@ -14,14 +14,14 @@ latest - - - - + + + + - - + + diff --git a/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=openapi.verified.txt b/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=openapi.verified.txt index 8580d9cd..a51ff5f9 100644 --- a/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=openapi.verified.txt +++ b/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=openapi.verified.txt @@ -299,8 +299,8 @@ }, status: { type: integer, - nullable: true, - format: int32 + format: int32, + nullable: true }, detail: { type: string, diff --git a/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=swagger.verified.txt b/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=swagger.verified.txt index 4ce97312..53436825 100644 --- a/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=swagger.verified.txt +++ b/tests/TodoApp.Tests/OpenApiTests.Schema_Is_Correct_schemaUrl=swagger.verified.txt @@ -260,8 +260,8 @@ properties: { text: { type: string, - nullable: true, - description: Gets or sets the text of the Todo item. + description: Gets or sets the text of the Todo item., + nullable: true } }, additionalProperties: false, @@ -275,8 +275,8 @@ properties: { id: { type: string, - nullable: true, - description: Gets or sets the ID of the created Todo item. + description: Gets or sets the ID of the created Todo item., + nullable: true } }, additionalProperties: false, @@ -298,8 +298,8 @@ }, status: { type: integer, - nullable: true, - format: int32 + format: int32, + nullable: true }, detail: { type: string, @@ -322,13 +322,13 @@ properties: { id: { type: string, - nullable: true, - description: Gets or sets the ID of the Todo item. + description: Gets or sets the ID of the Todo item., + nullable: true }, text: { type: string, - nullable: true, - description: Gets or sets the text of the Todo item. + description: Gets or sets the text of the Todo item., + nullable: true }, isCompleted: { type: boolean, @@ -336,8 +336,8 @@ }, lastUpdated: { type: string, - nullable: true, - description: Gets or sets the date and time the Todo item was last updated. + description: Gets or sets the date and time the Todo item was last updated., + nullable: true } }, additionalProperties: false, @@ -353,11 +353,11 @@ properties: { items: { type: array, - nullable: true, items: { $ref: #/components/schemas/TodoItemModel }, - description: Gets or sets the Todo item(s). + description: Gets or sets the Todo item(s)., + nullable: true } }, additionalProperties: false, diff --git a/tests/TodoApp.Tests/OpenApiTests.cs b/tests/TodoApp.Tests/OpenApiTests.cs index 06a2f654..813b8914 100644 --- a/tests/TodoApp.Tests/OpenApiTests.cs +++ b/tests/TodoApp.Tests/OpenApiTests.cs @@ -1,9 +1,7 @@ // Copyright (c) Martin Costello, 2024. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. -using Microsoft.OpenApi.Extensions; -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Validations; +using Microsoft.OpenApi; namespace TodoApp; diff --git a/tests/TodoApp.Tests/TodoApp.Tests.csproj b/tests/TodoApp.Tests/TodoApp.Tests.csproj index ed8ad13b..8dc020ec 100644 --- a/tests/TodoApp.Tests/TodoApp.Tests.csproj +++ b/tests/TodoApp.Tests/TodoApp.Tests.csproj @@ -10,7 +10,7 @@ - +