Class MediaBlocksPipelineJsonSerializer
- Assembly
- VisioForge.Core.dll
Serializes and deserializes versioned Media Blocks pipeline JSON documents with schema migrations, string, stream and file conveniences. The document is the source of truth for editing and persistence; materializing it into a live VisioForge.Core.MediaBlocks.MediaBlocksPipeline is a separate step.
public static class MediaBlocksPipelineJsonSerializerInheritance
Inherited Members
Methods
Load(string)
Loads a pipeline document from JSON text, applying schema migrations and structural validation. Unknown fields and sections are preserved; an unknown or unavailable block never discards the document.
public static MediaBlocksPipelineLoadResult Load(string json)Parameters
jsonstring-
The JSON text.
Returns
- MediaBlocksPipelineLoadResult
-
The load result with the document and diagnostics.
LoadAsync(Stream)
Loads a pipeline document from a stream.
public static Task<MediaBlocksPipelineLoadResult> LoadAsync(Stream stream)Parameters
streamStream-
The source stream positioned at the start of the JSON text.
Returns
- Task<MediaBlocksPipelineLoadResult>
-
The load result with the document and diagnostics.
LoadFileAsync(string)
Loads a pipeline document from a file.
public static Task<MediaBlocksPipelineLoadResult> LoadFileAsync(string path)Parameters
pathstring-
The source file path.
Returns
- Task<MediaBlocksPipelineLoadResult>
-
The load result with the document and diagnostics.
SaveFileAsync(MediaBlocksPipelineDocument, string)
Saves a pipeline document to a file.
public static Task SaveFileAsync(MediaBlocksPipelineDocument document, string path)Parameters
documentMediaBlocksPipelineDocument-
The document to save.
pathstring-
The destination file path.
Returns
Serialize(MediaBlocksPipelineDocument)
Serializes a pipeline document to a JSON string. A document with no schema version is stamped with the current schema version.
public static string Serialize(MediaBlocksPipelineDocument document)Parameters
documentMediaBlocksPipelineDocument-
The document to serialize.
Returns
- string
-
The indented JSON text.
SerializeAsync(MediaBlocksPipelineDocument, Stream)
Serializes a pipeline document to a stream.
public static Task SerializeAsync(MediaBlocksPipelineDocument document, Stream stream)Parameters
documentMediaBlocksPipelineDocument-
The document to serialize.
streamStream-
The destination stream.