Skip to content

Conversation

@marcominerva
Copy link
Owner

This pull request updates the project to support .NET 10.0 and the latest versions of related dependencies, including C# 14 and Swashbuckle 10.0.0. It also updates sample projects and refines Swagger integration to use new OpenAPI types and improved extension methods.

.NET and C# version updates:

  • Updated all relevant project files to target .NET 10.0 and use C# 14 features, ensuring compatibility with the latest language and runtime features. (.github/copilot-instructions.md [1] samples//.csproj [2] [3] src/SimpleAuthentication.Abstractions/SimpleAuthentication.Abstractions.csproj [4] src/SimpleAuthentication.Swashbuckle/SimpleAuthentication.Swashbuckle.csproj [5]

Dependency upgrades:

  • Upgraded key NuGet packages to their latest major versions, including Microsoft.AspNetCore.OpenApi, Swashbuckle.AspNetCore.SwaggerUI, Swashbuckle.AspNetCore.SwaggerGen, and Microsoft.AspNetCore.Authentication.JwtBearer for all supported target frameworks. (samples//.csproj [1] [2] [3] src/SimpleAuthentication.Abstractions/SimpleAuthentication.Abstractions.csproj [4] src/SimpleAuthentication.Swashbuckle/SimpleAuthentication.Swashbuckle.csproj [5] [6] [7]

Swagger/OpenAPI integration improvements:

  • Refactored Swagger-related code to use the new Microsoft.OpenApi types instead of Microsoft.OpenApi.Models, updated helper methods, and improved extension methods for adding authentication support in Swagger, including better handling of additional security definitions. (src/SimpleAuthentication.Swashbuckle/Swagger/AuthenticationOperationFilter.cs [1] Swagger/OpenApiHelpers.cs [2] [3] Swagger/ProblemDetailsDocumentFilter.cs [4] SwaggerExtensions.cs [5] [6] [7] [8]

Sample project enhancements:

  • Updated sample projects to use the new target frameworks and dependencies, and improved Swagger usage (e.g., specifying OpenAPI 3.1, using .WithDescription() instead of .WithOpenApi() for endpoint documentation). (samples/MinimalApis/Net8JwtBearerSample/Net8JwtBearerSample.csproj [1] Program.cs [2] [3] [4] [5]

Project structure and references:

  • Cleaned up and updated project references, ensuring correct dependencies and removing unnecessary references in sample projects. (samples/MinimalApis/*Sample.csproj [1] src/SimpleAuthentication.Swashbuckle/SimpleAuthentication.Swashbuckle.csproj [2] [3]

These changes collectively modernize the codebase, improve maintainability, and ensure compatibility with the latest .NET and OpenAPI tooling.

Updated projects to target .NET 10, leveraging new features and APIs.
Upgraded dependencies, including `Microsoft.AspNetCore.OpenApi`
and `Swashbuckle.AspNetCore.SwaggerUI`, to their latest versions.
Introduced conditional compilation for `net10.0` to support new
framework-specific features.

Enhanced OpenAPI integration:
- Added `DefaultResponseDocumentTransformer` for error schemas.
- Added `OAuth2AuthenticationDocumentTransformer` for OAuth2 support.
- Improved `AuthenticationDocumentTransformer` and
  `AuthenticationOperationTransformer` for security schemes and
  authorization policies.

Removed outdated `#if NET9_0_OR_GREATER` directives and replaced
them with more specific conditions. Ensured backward compatibility
with `net8.0` and `net9.0`.
Updated project files to upgrade `Swashbuckle.AspNetCore` to v10.0.0 and align with OpenAPI 3.1. Refactored `Program.cs` to use `.WithDescription()` for better readability. Added `net10.0` support in `SimpleAuthentication.Swashbuckle.csproj`.

Replaced `Microsoft.OpenApi.Models` with `Microsoft.OpenApi` across multiple files to align with updated libraries. Refactored `SwaggerExtensions.cs` to improve flexibility and maintainability by introducing helper methods and supporting additional security definitions.

Upgraded `Nerdbank.GitVersioning` to v3.9.50 and made general improvements to simplify OpenAPI constructs and enhance compatibility with newer library versions.
@marcominerva marcominerva merged commit 30eaec1 into master Nov 12, 2025
7 checks passed
@marcominerva marcominerva linked an issue Nov 12, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to .NET 10 with focus on OpenAPI breaking changes

2 participants