AddOpenApi

The pair of ASP.NET Core calls that registers built-in OpenAPI document generation (AddOpenApi) and exposes the JSON document as an endpoint (MapOpenApi).

In more detail

They replaced the Swashbuckle dependency in the web API templates from .NET 9. Protect the endpoint according to who should see your API's shape.

Examples

builder.Services.AddOpenApi();
app.MapOpenApi();

Related terms

Taught in

References