Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

OpenApiEndpointRouteBuilderExtensions.MapOpenApi Method

Definition

Namespace:
Microsoft.AspNetCore.Builder
Assembly:
Microsoft.AspNetCore.OpenApi.dll
Package:
Microsoft.AspNetCore.OpenApi v10.0.0
Package:
Microsoft.AspNetCore.OpenApi v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.OpenApi v9.0.8
Source:
OpenApiEndpointRouteBuilderExtensions.cs
Source:
OpenApiEndpointRouteBuilderExtensions.cs
Source:
OpenApiEndpointRouteBuilderExtensions.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapOpenApi(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern = "/openapi/{documentName}.json");
static member MapOpenApi : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapOpenApi (endpoints As IEndpointRouteBuilder, Optional pattern As String = "/openapi/{documentName}.json") As IEndpointConventionBuilder

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


Feedback

Was this page helpful?