OpenApiDocumentTransformerContext.GetOrCreateSchemaAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或创建指定类型的值 OpenApiSchema 。 使用在文档上注册的任何 IOpenApiSchemaTransformer架构来扩充架构。 如果 parameterDescription 不是 null,架构将随 ApiParameterDescription 信息一起扩充。
public System.Threading.Tasks.Task<Microsoft.OpenApi.OpenApiSchema> GetOrCreateSchemaAsync(Type type, Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterDescription? parameterDescription = default, System.Threading.CancellationToken cancellationToken = default);
member this.GetOrCreateSchemaAsync : Type * Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterDescription * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.OpenApi.OpenApiSchema>
Public Function GetOrCreateSchemaAsync (type As Type, Optional parameterDescription As ApiParameterDescription = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OpenApiSchema)
参数
- type
- Type
要为其创建架构的类型。
- parameterDescription
- ApiParameterDescription
用于扩充架构的可选参数说明。
- cancellationToken
- CancellationToken
取消作的取消令牌。
返回
一个表示异步作的任务,其值为类型 OpenApiSchema。