OpenApiEndpointConventionBuilderExtensions.WithOpenApi 方法

定义

重载

WithOpenApi<TBuilder>(TBuilder)

将 OpenAPI 注释添加到与当前终结点关联的 Metadata

WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>)

将 OpenAPI 批注添加到与当前终结点关联的 Metadata,并使用给定 configureOperation对其进行修改。

WithOpenApi<TBuilder>(TBuilder)

Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs

将 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

IEndpointConventionBuilder

返回

TBuilder

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

注解

此方法不与 ASP.NET Core 中的内置 OpenAPI 文档生成支持集成,主要用于沿 Swashbuckle.AspNetCore 使用。

适用于

WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>)

Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs

将 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

IEndpointConventionBuilder

configureOperation
Func<OpenApiOperation,OpenApiOperation>

返回给定生成的操作的新 OpenAPI 批注的 Func<T,TResult>

返回

TBuilder

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

注解

此方法不与 ASP.NET Core 中的内置 OpenAPI 文档生成支持集成,主要用于沿 Swashbuckle.AspNetCore 使用。

适用于