Skip to content

✨ Support ASP.NET Core OpenAPI#22

Merged
desjoerd merged 15 commits intomainfrom
feature/net10-v2
Nov 30, 2025
Merged

✨ Support ASP.NET Core OpenAPI#22
desjoerd merged 15 commits intomainfrom
feature/net10-v2

Conversation

@desjoerd
Copy link
Owner

@desjoerd desjoerd commented Oct 24, 2025

Add support for ASP.NET Core OpenAPI (.NET 10).

There is one known issue around circular references which requires dotnet/aspnetcore#64109 to be merged.

@desjoerd desjoerd marked this pull request as ready for review November 29, 2025 18:21
@desjoerd desjoerd requested a review from Copilot November 30, 2025 20:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for ASP.NET Core OpenAPI in .NET 10, introducing a new OptionalValues.OpenApi library that enables OptionalValue<T> types to be properly represented in OpenAPI documentation. The implementation includes a schema transformer that unwraps OptionalValue types to their underlying types while preserving nullability and validation attributes.

Key Changes

  • Introduces new OptionalValues.OpenApi library targeting .NET 10 with schema transformation support
  • Upgrades SDK to .NET 10 (10.0.100) and adds .NET 10 to target frameworks
  • Adds comprehensive test infrastructure including a test application and integration tests

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
version.json Bumps version to 0.8-preview and adds release configuration for preview releases
global.json Updates SDK version to 10.0.100 for .NET 10 support
Directory.Build.props Adds target framework variables for .NET 10 and differentiates Swashbuckle vs OpenApi frameworks
Directory.Packages.props Adds .NET 10 package references (Microsoft.AspNetCore.OpenApi, Microsoft.AspNetCore.Mvc.Testing, Microsoft.Extensions.ApiDescription.Server)
src/OptionalValues.OpenApi/OptionalValuesSchemaTransformer.cs Core transformer that unwraps OptionalValue types and applies schema transformations
src/OptionalValues.OpenApi/OpenApiOptionsExtensions.cs Public API extension methods to enable OptionalValue support in OpenAPI configuration
src/OptionalValues.OpenApi/OptionalValues.OpenApi.csproj Project file for new OpenAPI library targeting .NET 10
src/OptionalValues.OpenApi/PublicAPI.*.txt Public API surface documentation for the new library
src/OptionalValues.Swashbuckle/OptionalValues.Swashbuckle.csproj Updates to use Swashbuckle-specific target frameworks
test/OptionalValues.OpenApi.Tests/* Integration test suite that validates schema generation for primitives and references
test/OptionalValues.OpenApi.TestApp/* Test web application with sample endpoints demonstrating OptionalValue usage
test/OptionalValues.Swashbuckle.Tests/OptionalValues.Swashbuckle.Tests.csproj Updates to use Swashbuckle-specific target frameworks
examples/OptionalValues.Examples.OpenApi/* Example application demonstrating OptionalValue with ASP.NET Core OpenAPI
examples/OptionalValues.Examples.Swashbuckle/* Updates Swashbuckle example with version override and regenerated OpenAPI spec
OptionalValues.slnx Adds new OpenAPI projects to solution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

desjoerd and others added 8 commits November 30, 2025 21:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix formatting

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@desjoerd desjoerd merged commit 54233ef into main Nov 30, 2025
1 check passed
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.

1 participant

Comments