Share via


OpenApiDocumentTransformerContext.GetOrCreateSchemaAsync Method

Definition

Gets or creates an 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.Models.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.Models.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

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

Applies to