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
- OpenAPI — A standard, language-neutral format for describing an HTTP API: its paths, operations, parameters, request and response schemas, errors and security.
- Scalar — An open-source browser interface that renders an OpenAPI document as interactive API documentation and can send test requests.
- Swashbuckle — A community library that generated OpenAPI documents and the Swagger UI page for ASP.NET Core, included in templates before .NET 9.
Taught in
- OpenAPI Generation in .NET 9 — Modern .NET Core, C# & Enterprise Microservices
- API Documentation UI with Scalar — Modern .NET Core, C# & Enterprise Microservices