Native OpenAPI and Swagger Support in ASP.NET Core 9 New native tooling sets allowing Minimal APIs to be documented more easily, powerfully, and natively

How to fix the "No executable found matching command dotnet-ef" error in Visual Studio with .NET Core

In today’s modern backend development landscape, automatic API documentation has become an essential standard. Whether you're exposing an API for internal use or external consumption by other teams or clients, providing a clear, navigable, and standards-compliant interface is a vital part of the software lifecycle.

In this context, the OpenAPI standard (formerly known as Swagger) has emerged as the de facto language for describing API contracts in a formal, readable, and interoperable way. Thanks to its declarative structure in JSON or YAML, OpenAPI not only allows interactive documentation, but also supports automatic client generation, validators, and testing tools.

ASP.NET Core 9 – and in particular its Minimal API model – further embraces the OpenAPI ecosystem with a set of native enhancements that dramatically simplify the creation of OpenAPI documents and the integration with tools like Swagger UI, ReDoc, and Scalar.

More descriptive APIs with fluent API support

In .NET 9, each endpoint can be enriched with metadata through fluent methods. This allows developers to build documentation within the code itself, ensuring greater consistency between business logic and API descriptions.

Here's a practical example:

In just a few lines:

  • We assign a logical name to the endpoint
  • We set a tag (used to group endpoints in the UI)
  • We provide a summary and a detailed description
  • We formally declare the HTTP response type (e.g., 200 OK with a typed payload)

All of this is automatically reflected in the generated OpenAPI document with no extra configuration.

Modular organization with MapGroup()

The MapGroup() feature, designed to organize endpoints into logical sections, is now fully integrated with the OpenAPI system. Groups are represented as distinct tags in the documentation, improving clarity and navigation.

Example:

In the generated Swagger UI, the "Books" section will contain both endpoints, already categorized and documented based on their metadata.

Built-in tooling ready out of the box

With ASP.NET Core 9, you no longer need external libraries to get Swagger UI up and running. You just configure your services like this:

And in your middleware pipeline:

In addition to Swagger UI, you can easily integrate ReDoc and Scalar for richer or more interactive documentation experiences.

Why does this matter?

  • Simplifies life for frontend teams and DevOps engineers
  • Enables automated testing and validation in CI/CD pipelines
  • Reduces human error in API contract definition
  • Supports automatic client generation (TypeScript, C#, Java…)
  • Facilitates API governance and traceability in enterprise environments

In summary, ASP.NET Core 9 brings OpenAPI documentation to the next level: more intuitive,
more powerful, and above all natively integrated into Minimal API development.
A decisive step toward a developer-first, contract-oriented future.

About Ryan

IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it's also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.

View all posts by Ryan

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.