Share via


OpenApiEndpointConventionBuilderExtensions.WithOpenApi Method

Definition

Overloads

WithOpenApi<TBuilder>(TBuilder)

Adds an OpenAPI annotation to Metadata associated with the current endpoint.

WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>)

Adds an OpenAPI annotation to Metadata associated with the current endpoint and modifies it with the given configureOperation.

WithOpenApi<TBuilder>(TBuilder)

Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs

Adds an OpenAPI annotation to Metadata associated with the current endpoint.

public static TBuilder WithOpenApi<TBuilder> (this TBuilder builder) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithOpenApi : 'Builder -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithOpenApi(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder) As TBuilder

Type Parameters

TBuilder

Parameters

builder
TBuilder

The IEndpointConventionBuilder.

Returns

TBuilder

A IEndpointConventionBuilder that can be used to further customize the endpoint.

Remarks

This method does not integrate with built-in OpenAPI document generation support in ASP.NET Core and is primarily intended for consumption along-side Swashbuckle.AspNetCore.

Applies to

WithOpenApi<TBuilder>(TBuilder, Func<OpenApiOperation,OpenApiOperation>)

Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs
Source:
OpenApiEndpointConventionBuilderExtensions.cs

Adds an OpenAPI annotation to Metadata associated with the current endpoint and modifies it with the given configureOperation.

public static TBuilder WithOpenApi<TBuilder> (this TBuilder builder, Func<Microsoft.OpenApi.Models.OpenApiOperation,Microsoft.OpenApi.Models.OpenApiOperation> configureOperation) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member WithOpenApi : 'Builder * Func<Microsoft.OpenApi.Models.OpenApiOperation, Microsoft.OpenApi.Models.OpenApiOperation> -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function WithOpenApi(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, configureOperation As Func(Of OpenApiOperation, OpenApiOperation)) As TBuilder

Type Parameters

TBuilder

Parameters

builder
TBuilder

The IEndpointConventionBuilder.

configureOperation
Func<OpenApiOperation,OpenApiOperation>

An Func<T,TResult> that returns a new OpenAPI annotation given a generated operation.

Returns

TBuilder

A IEndpointConventionBuilder that can be used to further customize the endpoint.

Remarks

This method does not integrate with built-in OpenAPI document generation support in ASP.NET Core and is primarily intended for consumption along-side Swashbuckle.AspNetCore.

Applies to