OpenApiOptions 类

定义

用于支持 OpenAPI 文档构造的选项。

public sealed class OpenApiOptions
type OpenApiOptions = class
Public NotInheritable Class OpenApiOptions
继承
OpenApiOptions

构造函数

名称 说明
OpenApiOptions()

使用默认ShouldInclude谓词初始化类的新实例OpenApiOptions

属性

名称 说明
CreateSchemaReferenceId

确定应如何为与给定 OpenAPI 文档中的类型关联的架构创建引用 ID 的委托。

DocumentName

OpenApiOptions 实例与此实例关联的 OpenAPI 文档的名称。

OpenApiVersion

要使用的 OpenAPI 规范的版本。 默认为 OpenApi3_1

ShouldInclude

用于确定给定的 OpenAPI 文档中是否应包含给定 ApiDescription 的委托。

方法

名称 说明
AddDocumentTransformer(Func<OpenApiDocument,OpenApiDocumentTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的文档转换器。

AddDocumentTransformer(Func<OpenApiDocument,OpenApiDocumentTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的文档转换器。

AddDocumentTransformer(IOpenApiDocumentTransformer)

在当前OpenApiOptions实例上注册给定实例IOpenApiDocumentTransformer

AddDocumentTransformer<TTransformerType>()

在当前 OpenApiOptions 实例上注册新的文档转换器。

AddOperationTransformer(Func<OpenApiOperation,OpenApiOperationTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的操作转换器。

AddOperationTransformer(Func<OpenApiOperation,OpenApiOperationTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的操作转换器。

AddOperationTransformer(IOpenApiOperationTransformer)

在当前OpenApiOptions实例上注册给定实例IOpenApiOperationTransformer

AddOperationTransformer<TTransformerType>()

在当前 OpenApiOptions 实例上注册新的操作转换器。

AddSchemaTransformer(Func<OpenApiSchema,OpenApiSchemaTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的架构转换器。

AddSchemaTransformer(Func<OpenApiSchema,OpenApiSchemaTransformerContext,CancellationToken,Task>)

将给定委托注册为当前 OpenApiOptions 实例上的架构转换器。

AddSchemaTransformer(IOpenApiSchemaTransformer)

在当前OpenApiOptions实例上注册给定实例IOpenApiOperationTransformer

AddSchemaTransformer<TTransformerType>()

在当前 OpenApiOptions 实例上注册新的架构转换器。

CreateDefaultSchemaReferenceId(JsonTypeInfo)

用于为给定 JsonTypeInfo的架构引用 ID 创建架构引用 ID 的默认实现。

适用于