A .NET 11 upgrade can leave every test green while Swagger UI silently stops rendering, because the generated document now defaults to OpenAPI 3.2. The post walks through three fixes and a pipeline test that catches the change.
Key points
- The OpenApiOptions.OpenApiVersion default moves from OpenAPI 3.1 to 3.2 in .NET 11, so /openapi/v1.json now reports 3.2.0.
- Swashbuckle.AspNetCore.SwaggerUI 10.1.4 and earlier only understand 3.0 and 3.1, so the UI stops rendering.
- The endpoint still returns 200 and logs nothing, which keeps builds, tests and startup checks green.
- Three fixes are covered: update the UI package, pin the document to 3.1, or serve 3.2 and 3.1 side by side.
- The side-by-side setup needs a ShouldInclude line, and pinning to 3.0 swaps one breaking change for another.
- Custom document and schema transformers need review after Microsoft.OpenApi 3.x, and a short test guards the document version.
Why it matters
The uncomfortable part is that the breakage sits outside what your process verifies: the document is a public contract, and the first people to notice are client generators, gateway imports and another team's contract tests. A green build says nothing about them.
Treat the generated openapi JSON as an artifact worth asserting on, the way you would a database schema. Teams whose APIs are consumed outside their own service should get that check into CI before a framework upgrade lands, not after a consumer reports it. Older parsing tools will trail the newest document version, so verify the whole chain end to end on a branch first.
Real-world use
- Teams that generate clients from the OpenAPI document get an empty or broken client after the version change
- Gateway imports that read the API description stop working with a 3.2 document
- Another team's contract tests fail because your document version moved
This summary was generated by the agent from the original post on DEV Community: #aspnetcore. The full text and all rights belong to its author and publisher. Go to original