Skip to content

Upgrading Swashbuckle.AspNetCore.Annotations 9 to 10

Breaking9.0.6 → 10.3.1Breaking4Security1New7Changed17Fixed25Other31

BreakingUpgrade verdict

4 breaking changes and a security fix.

  • The testing helper package for xUnit is gone and will not get new versions.
  • If you use the WithOpenApi() method with Swashbuckle, it is no longer supported.
  • You can now generate OpenAPI 3.1 documents, but only if you explicitly turn it on.
  • The underlying OpenAPI library was upgraded to a version with many breaking API changes.
Top 4 of 5 that need code or config changes

Swashbuckle.AspNetCore.Annotations publishes official migration guides for versions 10, 10. They cover more than the release notes do.

V10 migration guide ↗OpenAPI.NET v2 Upgrade Guide ↗

Target frameworks requirement changed in 10.0.0: net8.0, net9.0 → net10.0, net8.0, net9.0.

1 package of its own release moves with it.

Breaking4
Removes the Swashbuckle.AspNetCore.ApiTesting.Xunit package, which depended on unsupported Xunit v2.
Swashbuckle.AspNetCore.ApiTesting.Xunit
Removes support for using Swashbuckle.AspNetCore with the ASP.NET Core WithOpenApi() method.
WithOpenApi()
Adds support for OpenAPI 3.1 documents, which is opt-in and requires setting OpenApiVersion.
OpenApiSpecVersion.OpenApi3_1UseSwagger
Depends on OpenAPI.NET v2.3, which introduces many breaking changes to the public API surface.
Security1
Updates Microsoft.OpenApi to 2.7.5 to pick up the fix for GHSA-v5pm-xwqc-g5wc.
Microsoft.OpenApi