Migrate Swashbuckle to built-in OpenAPI

Proprietary

Migrate from Swashbuckle to the built-in OpenAPI support in ASP.NET Core 10+. Replaces AddSwaggerGen() with AddOpenApi(), UseSwaggerUI() with MapOpenApi(), removes UseSwagger(), removes Swashbuckle packages, and adds Microsoft.AspNetCore.OpenApi. Only fires when every project targets net10.0+ (the version that ships Microsoft.OpenApi 2.x with its flattened type namespaces).

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.MigrateSwashbuckleToOpenApi
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.MigrateSwashbuckleToOpenApi

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.