A step-by-step guide to implementing API versioning in .NET 10 applications using the new Asp.Versioning v10 package alongside Microsoft.AspNetCore.OpenApi. Covers both controllers and Minimal APIs, explains versioning strategies (URL, query string, header), and shows how to generate separate OpenAPI documents per version using the new WithDocumentPerVersion() method. Also demonstrates integrating SwaggerUI and Scalar for visualizing versioned API docs, compares the v8 vs v10 setup to highlight reduced boilerplate, and briefly covers API linting with Spectral and oasdiff.
Table of contents
The importance of API versioning Copy linkThe changes to OpenAPI in .NET 9 and 10 Copy linkAn introduction to API versioning with Asp.Versioning Copy linkCombining API versioning with OpenAPI in .NET 10 Copy linkAdding SwaggerUI and Scalar support for versioned APIs Copy linkMigrating from Asp.Versioning v8 to v10 Copy linkHow Asp.Versioning v10 improves the setup of API versioning Copy linkAdding API linting to your versioned OpenAPI documents Copy linkFinishing up Copy linkASP.NET Core Community Standup Copy linkSort: