Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

JsonSerializer

class JsonSerializer

Module: System.Data.Json
Assembly: System.Data.dll
Source file: JsonSerializer.rvn

Inheritance: Object → JsonSerializer

Provisional DOM codec and bounded nested object mapper supporting strings and borrowed UTF-8 streams.

Remarks

DeserializeNode/SerializeNode operate on the DOM. Deserialize and Serialize Object overloads map public String, Int32 and Boolean properties through checked runtime reflection. Development after Preview 10 also maps nested nongeneric reference objects, typed arrays (including jagged arrays) and root String/Int32/Boolean values. Objects and arrays share the four-container depth bound. Development explicit JsonValue and concrete JSON node declarations are supported at roots, properties and array elements; nodes retain JSON content, including explicit JsonNull. Concrete node kinds must match. Development supports Sequence/List/ArrayList and string-keyed Map/MutableMap/HashMap with recursively supported elements, constructing ArrayList or ordinal HashMap. CLR null, other collection families, non-string map keys and other polymorphic property/element values are unsupported; shared references become independent JSON subtrees. Containers are limited to 31 entries; complete parsing/writing is limited to 1024 UTF-8 bytes, four nested containers and 32 value occurrences. APIs are provisional.

Methods

26 items
Static member: Deserialize(input: InputStream, type: TypeInfo) -> Task<Result<object, JsonError>> Parses bounded JSON and constructs a supported value through runtime reflection.
Static member: Deserialize(text: string, type: TypeInfo) -> Result<object, JsonError> Parses bounded JSON and constructs a supported value through runtime reflection.
Static member: Deserialize(utf8: ReadOnlySlice<byte>, type: TypeInfo) -> Result<object, JsonError> Deserializes a complete borrowed UTF-8 document into the specified supported type.
Static member: Deserialize<T>(input: InputStream) -> Task<Result<T, JsonError>> Synchronously reads bounded UTF-8 JSON and returns a typed model.
Static member: Deserialize<T>(text: string) -> Result<T, JsonError> Deserializes bounded JSON into a supported typed value.
Static member: Deserialize<T>(utf8: ReadOnlySlice<byte>) -> Result<T, JsonError> Deserializes a complete borrowed UTF-8 document using the supported object mapping contract.
Static member: DeserializeNode(input: InputStream, options: JsonDocumentOptions) -> Task<Result<JsonValue, JsonError>> Reads JSON to EOF with selected syntax and depth options.
Static member: DeserializeNode(input: InputStream) -> Task<Result<JsonValue, JsonError>> Reads strict JSON to EOF, leaving the input stream open.
Static member: DeserializeNode(text: string, options: JsonDocumentOptions) -> Result<JsonValue, JsonError> Parses text using document syntax options.
Static member: DeserializeNode(text: string) -> Result<JsonValue, JsonError> Parses strict JSON with a maximum container depth of 64.
Static member: DeserializeNode(utf8: ReadOnlySlice<byte>, options: JsonDocumentOptions) -> Result<JsonValue, JsonError> Parses borrowed UTF-8 using document syntax options.
Static member: DeserializeNode(utf8: ReadOnlySlice<byte>) -> Result<JsonValue, JsonError> Parses a borrowed UTF-8 document with strict syntax and maximum depth 64.
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Static member: Serialize(output: OutputStream, value: object, options: JsonSerializerOptions) -> Task<Result<void, JsonError>> Serializes an object or JSON node with selected formatting to a stream left open.
Static member: Serialize(output: OutputStream, value: object) -> Task<Result<void, JsonError>> Maps an object and writes bounded UTF-8 JSON to a borrowed stream.
Static member: Serialize(value: object, options: JsonSerializerOptions) -> Result<string, JsonError> Serializes an object or JSON node using the selected output formatting.
Static member: Serialize(value: object) -> Result<string, JsonError> Serializes a scalar, typed array, supported collection or reference model.
Static member: SerializeNode(output: OutputStream, value: JsonValue, options: JsonSerializerOptions) -> Task<Result<void, JsonError>> Validates and serializes a node with the selected formatting before writing to the stream.
Static member: SerializeNode(output: OutputStream, value: JsonValue) -> Task<Result<void, JsonError>> Validates a complete document, then writes UTF-8 through StreamWriter.
Static member: SerializeNode(value: JsonValue, options: JsonSerializerOptions) -> Result<string, JsonError> Serializes a JSON node with compact or indented formatting.
Static member: SerializeNode(value: JsonValue) -> Result<string, JsonError> Writes a bounded DOM to compact JSON text.
Static member: SerializeToUtf8Bytes(value: object, options: JsonSerializerOptions) -> Result<byte[], JsonError> Serializes an object or JSON node directly into owned UTF-8 bytes with selected formatting.
Static member: SerializeToUtf8Bytes(value: object) -> Result<byte[], JsonError> Serializes an object or JSON node directly into owned UTF-8 bytes.
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString