Share via


OpenApiOperationTransformerContext.GetOrCreateSchemaAsync Method

Definition

Gets or creates an Microsoft.OpenApi.OpenApiSchema for the specified type. Augments the schema with any IOpenApiSchemaTransformers that are registered on the document. If parameterDescription is not null, the schema will be augmented with the ApiParameterDescription information.

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)

Parameters

type
Type

The type for which the schema is being created.

parameterDescription
ApiParameterDescription

An optional parameter description to augment the schema.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

Task<Microsoft.OpenApi.OpenApiSchema>

A task that represents the asynchronous operation, with a value of type Microsoft.OpenApi.OpenApiSchema.

Applies to