Table of Contents

Class AnnotationJson

Namespace
LMKit.Document.Annotations
Assembly
LM-Kit.NET.dll

The canonical JSON schema adapter of the LM-Kit annotation standard: loads Annotation records from and saves them to the standard's camelCase wire (see Annotations/ANNOTATION-STANDARD.md - field names are frozen; external stores persist this wire verbatim).

Parsing is tolerant: absent properties keep their defaults, unknown properties are preserved verbatim in ExtensionJson (forward compatibility). Writing omits defaults and re-emits preserved extensions, so load → save round-trips losslessly. Implemented with JsonDocument / Utf8JsonWriter only - no reflection, safe under AOT/WASM.

public static class AnnotationJson
Inheritance
AnnotationJson
Inherited Members

Methods

Parse(string)

Parses one record from its canonical JSON.

ParseBatch(string)

Parses a commit batch from its canonical JSON ({"create":[…],"update":[…],"delete":[{"id","pageIndex"},…]}). Tolerant: absent arrays stay null, malformed entries are skipped.

ParseList(string)

Parses a JSON array of records.

Read(JsonElement)

Reads one record from a parsed element.

Write(Annotation)

Serializes one record to its canonical JSON (defaults omitted).

WriteBatchResult(AnnotationBatchResult)

Serializes a batch outcome to its canonical JSON.

WriteList(IEnumerable<Annotation>)

Serializes a list of records to a canonical JSON array.

WriteTo(Utf8JsonWriter, Annotation)

Writes one record to an open writer (defaults omitted).

Share