OpenApiEndpointRouteBuilderExtensions.MapOpenApi 方法

定义

将终结点注册到当前应用程序以解析与当前应用程序关联的 OpenAPI 文档。

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

参数

pattern
String

要注册终结点的路由。 必须包含“documentName”路由参数。

返回

可用于进一步自定义终结点的 IEndpointRouteBuilder

适用于