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 使用。