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

API Browser

Member group

Deserialize

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

Overloads / Variants

Deserialize

static func Deserialize(input: InputStream, type: TypeInfo) -> Task<Result<object, JsonError>>

Source file: JsonSerializer.rvn

Parses bounded JSON and constructs a supported value through runtime reflection.

Parameters

Name Type Description
input InputStream JSON input stream, borrowed from its current position through EOF.
type TypeInfo Runtime-backed supported scalar, explicit JSON node type, typed array, supported built-in list/sequence/string-keyed map, or public nongeneric reference class with a public parameterless constructor.

Return value

Task<Result<Object, JsonError>>

The constructed object, a JSON validation error, UnsupportedMapping or Reflection retaining its cause.

Remarks

Exact property names; every public writable instance property must be present and be String, Int32, Boolean, an explicit JSON node type, a supported typed array, built-in list/sequence/string-keyed map or supported nested reference class. Unknown fields and nonpublic/read-only setters are ignored. The complete input tree is validated before model construction or setters. Development nested models use public parameterless constructors; explicit node declarations retain parsed nodes and enforce concrete kind matching. CLR null mapping, numeric coercion and naming policies remain unsupported. User constructor/setter Faults remain terminal. Synchronous; streams remain open and are not rewound on failure.

Deserialize

static func Deserialize(text: string, type: TypeInfo) -> Result<object, JsonError>

Source file: JsonSerializer.rvn

Parses bounded JSON and constructs a supported value through runtime reflection.

Parameters

Name Type Description
text String JSON text.
type TypeInfo Runtime-backed supported scalar, explicit JSON node type, typed array, supported built-in list/sequence/string-keyed map, or public nongeneric reference class with a public parameterless constructor.

Return value

Result<Object, JsonError>

The constructed object, a JSON validation error, UnsupportedMapping or Reflection retaining its cause.

Remarks

Exact property names; every public writable instance property must be present and be String, Int32, Boolean, an explicit JSON node type, a supported typed array, built-in list/sequence/string-keyed map or supported nested reference class. Unknown fields and nonpublic/read-only setters are ignored. The complete input tree is validated before model construction or setters. Development nested models use public parameterless constructors; explicit node declarations retain parsed nodes and enforce concrete kind matching. CLR null mapping, numeric coercion and naming policies remain unsupported. User constructor/setter Faults remain terminal. Synchronous; streams remain open and are not rewound on failure.

Deserialize

static func Deserialize(utf8: ReadOnlySlice<byte>, type: TypeInfo) -> Result<object, JsonError>

Source file: JsonSerializer.rvn

Deserializes a complete borrowed UTF-8 document into the specified supported type.

Parameters

Name Type Description
utf8 ReadOnlySlice<Byte> The complete document, borrowed only during this call.
type TypeInfo The supported target type.

Return value

Result<Object, JsonError>

An independently owned object or a quota, UTF-8, syntax or mapping error.

Deserialize

static func Deserialize<T>(input: InputStream) -> Task<Result<T, JsonError>>

Source file: JsonSerializer.rvn

Synchronously reads bounded UTF-8 JSON and returns a typed model.

Type parameters

Name Description
T String, Int32, Boolean, an explicit JsonValue or concrete JSON node type, a typed array or supported built-in list/sequence/string-keyed map of supported values, or a public nongen…

Parameters

Name Type Description
input InputStream Borrowed input stream, read from its current position through EOF within the document limit.

Return value

Task<Result<T, JsonError>>

The typed model or a structured JSON, read or reflection error.

Remarks

Same mapping rules as the TypeInfo overload. Leaves the stream open on success and expected error; failure does not rewind. No asynchronous parsing or cancellation.

Deserialize

static func Deserialize<T>(text: string) -> Result<T, JsonError>

Source file: JsonSerializer.rvn

Deserializes bounded JSON into a supported typed value.

Type parameters

Name Description
T String, Int32, Boolean, an explicit JsonValue or concrete JSON node type, a typed array or supported built-in list/sequence/string-keyed map of supported values, or a public nongen…

Parameters

Name Type Description
text String Bounded JSON text.

Return value

Result<T, JsonError>

The typed model or the same structured error as the TypeInfo overload.

Remarks

Uses the existing exact-name String, Int32 and Boolean property mapping. Other value types, unsupported collection families and non-string map keys return UnsupportedMapping. Sequence/List/ArrayList construct ArrayList; string-keyed Map/MutableMap/HashMap construct HashMap with ordinal comparison. Development arrays and nested objects follow declared types with four container levels including the root. Explicit JSON node types retain their JSON kind and content; concrete kind mismatches return TypeMismatch. JsonNull is a node, not a CLR null reference. Object declarations do not infer node types. Constructor and setter Faults remain terminal.

Deserialize

static func Deserialize<T>(utf8: ReadOnlySlice<byte>) -> Result<T, JsonError>

Source file: JsonSerializer.rvn

Deserializes a complete borrowed UTF-8 document using the supported object mapping contract.

Parameters

Name Type Description
utf8 ReadOnlySlice<Byte> The complete document, borrowed only during this call.

Return value

Result<T, JsonError>

An independently owned value or a quota, UTF-8, syntax or mapping error.