Skip to content

Upgrading Swashbuckle.AspNetCore.SwaggerGen 9 to 10

Breaking9.0.6 → 10.3.1Breaking4Security1New8Changed15Fixed25Other32

BreakingUpgrade verdict

4 breaking changes and a security fix.

  • The testing helper package for xunit v2 is gone and will not get new versions.
  • If your app uses the WithOpenApi() method alongside Swashbuckle, that combination no longer works.
  • You can now generate the newer OpenAPI 3.1 format, but you have to turn it on yourself.
  • The underlying OpenAPI library had a major update, so some code that uses its types will need changes.
Top 4 of 5 that need code or config changes

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

Breaking4
Removes the Swashbuckle.AspNetCore.ApiTesting.Xunit package, which depended on unsupported xunit v2.
Swashbuckle.AspNetCore.ApiTesting.Xunit
Removes support for use 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_1OpenApiVersion
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