Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion src/TodoApp/OpenApi/AspNetCore/AddExamplesTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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<string, IOpenApiSecurityScheme>();
document.Components.SecuritySchemes[referenceId] = scheme;
document.Security ??= [];
document.Security.Add(new() { [reference] = [] });
Expand Down
3 changes: 1 addition & 2 deletions src/TodoApp/OpenApi/ExamplesProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/TodoApp/OpenApi/Swashbuckle/AddDocumentTagsFilter.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -13,7 +13,7 @@ public class AddDocumentTagsFilter : IDocumentFilter
{
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
swaggerDoc.Tags ??= [];
swaggerDoc.Tags ??= new HashSet<OpenApiTag>();
swaggerDoc.Tags.Add(new() { Name = "TodoApp" });
}
}
2 changes: 1 addition & 1 deletion src/TodoApp/OpenApi/Swashbuckle/AddServersFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/TodoApp/OpenApi/Swashbuckle/ExampleFilter.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/TodoApp/TodoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.5.25277.114" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0-preview.5.25277.114" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="10.0.0-preview.5.25277.114" PrivateAssets="all" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview.18" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.6.25358.103" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0-preview.6.25358.103" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="10.0.0-preview.6.25358.103" PrivateAssets="all" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.8.3" PrivateAssets="all" />
<PackageReference Include="NSwag.AspNetCore" Version="14.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.0-pr.3283.1552" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.0.0-pr.3283.1552" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.0-pr.3283.1636" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.0.0-pr.3283.1636" />
</ItemGroup>
<ItemGroup>
<Content Update="package.json;package-lock.json;tsconfig.json" CopyToPublishDirectory="Never" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@
},
status: {
type: integer,
nullable: true,
format: int32
format: int32,
nullable: true
},
detail: {
type: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -298,8 +298,8 @@
},
status: {
type: integer,
nullable: true,
format: int32
format: int32,
nullable: true
},
detail: {
type: string,
Expand All @@ -322,22 +322,22 @@
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,
description: Gets or sets a value indicating whether the Todo item has been completed.
},
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,
Expand All @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions tests/TodoApp.Tests/OpenApiTests.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/TodoApp.Tests/TodoApp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="MartinCostello.Logging.XUnit.v3" Version="0.6.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.5.25277.114" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.6.25358.103" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.Playwright" Version="1.52.0" />
<PackageReference Include="Verify.XunitV3" Version="30.4.0" />
Expand Down
Loading