Skip to content

Upgrading Swashbuckle.AspNetCore 9 to 10

Breaking9.0.6 → 10.3.1Breaking4Security1New7Changed18Fixed25Other29

BreakingUpgrade verdict

4 breaking changes and a security fix.

  • The testing helper package for xunit is gone and will not get new versions.
  • If your app calls WithOpenApi() on endpoints, that no longer works with this package.
  • You can now generate OpenAPI 3.1 documents, but only if you turn it on; the default stays the same.
  • The underlying OpenAPI library had a major upgrade, so some code that uses its types directly will need updating.
Top 4 of 5 that need code or config changes

Swashbuckle.AspNetCore 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.

3 packages of its own release move 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 the OpenAPI version explicitly.
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