OpenApiSerializableExtensions.Serialize Method
Definition
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.
Overloads
Serialize<T>(T, OpenApiSpecVersion, OpenApiFormat) |
Serializes the IOpenApiSerializable to the Open API document as a string in the given format. |
Serialize<T>(T, IOpenApiWriter, OpenApiSpecVersion) |
Serializes the IOpenApiSerializable to Open API document using the given specification version and writer. |
Serialize<T>(T, Stream, OpenApiSpecVersion, OpenApiFormat) |
Serializes the IOpenApiSerializable to the Open API document using the given stream, specification version and the format. |
Serialize<T>(T, Stream, OpenApiSpecVersion, OpenApiFormat, OpenApiWriterSettings) |
Serializes the IOpenApiSerializable to the Open API document using the given stream, specification version and the format. |
Serialize<T>(T, OpenApiSpecVersion, OpenApiFormat)
Serializes the IOpenApiSerializable to the Open API document as a string in the given format.
public static string Serialize<T> (this T element, Microsoft.OpenApi.OpenApiSpecVersion specVersion, Microsoft.OpenApi.OpenApiFormat format) where T : Microsoft.OpenApi.Interfaces.IOpenApiSerializable;
static member Serialize : 'T * Microsoft.OpenApi.OpenApiSpecVersion * Microsoft.OpenApi.OpenApiFormat -> string (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiSerializable)
<Extension()>
Public Function Serialize(Of T As IOpenApiSerializable) (element As T, specVersion As OpenApiSpecVersion, format As OpenApiFormat) As String
Type Parameters
- T
Parameters
- element
- T
The Open API element.
- specVersion
- OpenApiSpecVersion
The Open API specification version.
- format
- OpenApiFormat
Open API document format.
Returns
Applies to
Serialize<T>(T, IOpenApiWriter, OpenApiSpecVersion)
Serializes the IOpenApiSerializable to Open API document using the given specification version and writer.
public static void Serialize<T> (this T element, Microsoft.OpenApi.Writers.IOpenApiWriter writer, Microsoft.OpenApi.OpenApiSpecVersion specVersion) where T : Microsoft.OpenApi.Interfaces.IOpenApiSerializable;
static member Serialize : 'T * Microsoft.OpenApi.Writers.IOpenApiWriter * Microsoft.OpenApi.OpenApiSpecVersion -> unit (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiSerializable)
<Extension()>
Public Sub Serialize(Of T As IOpenApiSerializable) (element As T, writer As IOpenApiWriter, specVersion As OpenApiSpecVersion)
Type Parameters
- T
Parameters
- element
- T
The Open API element.
- writer
- IOpenApiWriter
The output writer.
- specVersion
- OpenApiSpecVersion
Version of the specification the output should conform to
Applies to
Serialize<T>(T, Stream, OpenApiSpecVersion, OpenApiFormat)
Serializes the IOpenApiSerializable to the Open API document using the given stream, specification version and the format.
public static void Serialize<T> (this T element, System.IO.Stream stream, Microsoft.OpenApi.OpenApiSpecVersion specVersion, Microsoft.OpenApi.OpenApiFormat format) where T : Microsoft.OpenApi.Interfaces.IOpenApiSerializable;
static member Serialize : 'T * System.IO.Stream * Microsoft.OpenApi.OpenApiSpecVersion * Microsoft.OpenApi.OpenApiFormat -> unit (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiSerializable)
<Extension()>
Public Sub Serialize(Of T As IOpenApiSerializable) (element As T, stream As Stream, specVersion As OpenApiSpecVersion, format As OpenApiFormat)
Type Parameters
- T
Parameters
- element
- T
The Open API element.
- stream
- Stream
The given stream.
- specVersion
- OpenApiSpecVersion
The Open API specification version.
- format
- OpenApiFormat
The output format (JSON or YAML).
Applies to
Serialize<T>(T, Stream, OpenApiSpecVersion, OpenApiFormat, OpenApiWriterSettings)
Serializes the IOpenApiSerializable to the Open API document using the given stream, specification version and the format.
public static void Serialize<T> (this T element, System.IO.Stream stream, Microsoft.OpenApi.OpenApiSpecVersion specVersion, Microsoft.OpenApi.OpenApiFormat format, Microsoft.OpenApi.Writers.OpenApiWriterSettings settings) where T : Microsoft.OpenApi.Interfaces.IOpenApiSerializable;
static member Serialize : 'T * System.IO.Stream * Microsoft.OpenApi.OpenApiSpecVersion * Microsoft.OpenApi.OpenApiFormat * Microsoft.OpenApi.Writers.OpenApiWriterSettings -> unit (requires 'T :> Microsoft.OpenApi.Interfaces.IOpenApiSerializable)
<Extension()>
Public Sub Serialize(Of T As IOpenApiSerializable) (element As T, stream As Stream, specVersion As OpenApiSpecVersion, format As OpenApiFormat, settings As OpenApiWriterSettings)
Type Parameters
- T
Parameters
- element
- T
The Open API element.
- stream
- Stream
The given stream.
- specVersion
- OpenApiSpecVersion
The Open API specification version.
- format
- OpenApiFormat
The output format (JSON or YAML).
- settings
- OpenApiWriterSettings
Provide configuration settings for controlling writing output