OpenApiEndpointConventionBuilderExtensions.WithOpenApi 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
WithOpenApi<TBuilder>(TBuilder) |
將 OpenAPI 批註新增至與目前端點相關聯的 Metadata。 |
WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>) |
將 OpenAPI 批注新增至與目前端點相關聯的 Metadata,並使用指定的 |
WithOpenApi<TBuilder>(TBuilder)
將 OpenAPI 批註新增至與目前端點相關聯的 Metadata。
public static TBuilder WithOpenApi<TBuilder> (this TBuilder builder) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithOpenApi : 'Builder -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithOpenApi(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
傳回
TBuilder
可用來進一步自定義端點的 IEndpointConventionBuilder。
備註
此方法不會與 ASP.NET Core 中的內建 OpenAPI 檔產生支援整合,主要是用於在 Swashbuckle.AspNetCore 端取用。
適用於
WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>)
將 OpenAPI 批注新增至與目前端點相關聯的 Metadata,並使用指定的 configureOperation
加以修改。
public static TBuilder WithOpenApi<TBuilder> (this TBuilder builder, Func<Microsoft.OpenApi.Models.OpenApiOperation,Microsoft.OpenApi.Models.OpenApiOperation> configureOperation) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithOpenApi : 'Builder * Func<Microsoft.OpenApi.Models.OpenApiOperation, Microsoft.OpenApi.Models.OpenApiOperation> -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithOpenApi(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, configureOperation As Func(Of OpenApiOperation, OpenApiOperation)) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
- configureOperation
- Func<OpenApiOperation,OpenApiOperation>
傳回所產生作業之新 OpenAPI 批注的 Func<T,TResult>。
傳回
TBuilder
可用來進一步自定義端點的 IEndpointConventionBuilder。
備註
此方法不會與 ASP.NET Core 中的內建 OpenAPI 檔產生支援整合,主要是用於在 Swashbuckle.AspNetCore 端取用。