Share via


IOpenApiDocumentProvider.GetOpenApiDocumentAsync(CancellationToken) Method

Definition

Gets the OpenAPI document.

public System.Threading.Tasks.Task<Microsoft.OpenApi.Models.OpenApiDocument> GetOpenApiDocumentAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member GetOpenApiDocumentAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.OpenApi.Models.OpenApiDocument>
Public Function GetOpenApiDocumentAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of OpenApiDocument)

Parameters

cancellationToken
CancellationToken

A token to monitor for cancellation requests.

Returns

A task that represents the asynchronous operation. The task result contains the OpenAPI document.

Remarks

This method is typically used by consumers to retrieve the OpenAPI document. The generated document may not contain the appropriate servers information since it can be instantiated outside the context of an HTTP request. In these scenarios, the OpenApiDocument can be modified to include the appropriate servers information.

Applies to