Share via


OpenApiWriterExtensions.WriteOptionalObject<T> Method

Definition

Write the optional Open API object/element.

public static void WriteOptionalObject<T> (this Microsoft.OpenApi.Writers.IOpenApiWriter writer, string name, T value, Action<Microsoft.OpenApi.Writers.IOpenApiWriter,T> action) where T : Microsoft.OpenApi.Interfaces.IOpenApiElement;
static member WriteOptionalObject : Microsoft.OpenApi.Writers.IOpenApiWriter * string * 'T * Action<Microsoft.OpenApi.Writers.IOpenApiWriter, 'T (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiElement)> -> unit (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiElement)
<Extension()>
Public Sub WriteOptionalObject(Of T As IOpenApiElement) (writer As IOpenApiWriter, name As String, value As T, action As Action(Of IOpenApiWriter, T))

Type Parameters

T

The Open API element type. IOpenApiElement

Parameters

writer
IOpenApiWriter

The Open API writer.

name
String

The property name.

value
T

The property value.

action
Action<IOpenApiWriter,T>

The proprety value writer action.

Applies to