Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

OpenApiOptions Class

Definition

Namespace:
Microsoft.AspNetCore.OpenApi
Assembly:
Microsoft.AspNetCore.OpenApi.dll
Package:
Microsoft.AspNetCore.OpenApi v10.0.0
Package:
Microsoft.AspNetCore.OpenApi v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.OpenApi v9.0.8
Source:
OpenApiOptions.cs
Source:
OpenApiOptions.cs
Source:
OpenApiOptions.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Options to support the construction of OpenAPI documents.

public sealed class OpenApiOptions
type OpenApiOptions = class
Public NotInheritable Class OpenApiOptions
Inheritance
OpenApiOptions

Constructors

Name Description
OpenApiOptions()

Initializes a new instance of the OpenApiOptions class with the default ShouldInclude predicate.

Properties

Name Description
CreateSchemaReferenceId

A delegate to determine how reference IDs should be created for schemas associated with types in the given OpenAPI document.

DocumentName

The name of the OpenAPI document this OpenApiOptions instance is associated with.

OpenApiVersion

The version of the OpenAPI specification to use. Defaults to OpenApi3_1.

ShouldInclude

A delegate to determine whether a given ApiDescription should be included in the given OpenAPI document.

Methods

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

Registers a given delegate as a document transformer on the current OpenApiOptions instance.

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

Registers a given delegate as a document transformer on the current OpenApiOptions instance.

AddDocumentTransformer(IOpenApiDocumentTransformer)

Registers a given instance of IOpenApiDocumentTransformer on the current OpenApiOptions instance.

AddDocumentTransformer<TTransformerType>()

Registers a new document transformer on the current OpenApiOptions instance.

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

Registers a given delegate as an operation transformer on the current OpenApiOptions instance.

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

Registers a given delegate as an operation transformer on the current OpenApiOptions instance.

AddOperationTransformer(IOpenApiOperationTransformer)

Registers a given instance of IOpenApiOperationTransformer on the current OpenApiOptions instance.

AddOperationTransformer<TTransformerType>()

Registers a new operation transformer on the current OpenApiOptions instance.

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

Registers a given delegate as a schema transformer on the current OpenApiOptions instance.

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

Registers a given delegate as a schema transformer on the current OpenApiOptions instance.

AddSchemaTransformer(IOpenApiSchemaTransformer)

Registers a given instance of IOpenApiOperationTransformer on the current OpenApiOptions instance.

AddSchemaTransformer<TTransformerType>()

Registers a new schema transformer on the current OpenApiOptions instance.

CreateDefaultSchemaReferenceId(JsonTypeInfo)

A default implementation for creating a schema reference ID for a given JsonTypeInfo.

Applies to


Feedback

Was this page helpful?