共用方式為


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

適用於