OpenApiEndpointRouteBuilderExtensions.MapOpenApi Method

Definition

Register an endpoint onto the current application for resolving the OpenAPI document associated with the current application.

C#
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapOpenApi (this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern = "/openapi/{documentName}.json");

Parameters

pattern
String

The route to register the endpoint on. Must include the 'documentName' route parameter.

Returns

An IEndpointRouteBuilder that can be used to further customize the endpoint.

Applies to

Product Versions
ASP.NET Core 9.0