SlySerialize.top_level#

Functions and converters for using SlySerialize.

Functions

from_json(cls, value[, loader, allow_extra_keys])

Converts a value from JSON to a type T.

from_json_async(cls, value[, loader, ...])

Converts a value from JSON to a type T with support for async converters.

to_json(value[, converter])

Converts a value to JSON.

SlySerialize.top_level.from_json(cls: type[T], value: JsonType, loader: Loader[JsonType, T] | None = None, allow_extra_keys: bool = False) T#

Converts a value from JSON to a type T.

If not specified, uses the default converter.

await SlySerialize.top_level.from_json_async(cls: type[T], value: JsonType, loader: Loader[JsonType, T] | None = None, allow_extra_keys: bool = False) T#

Converts a value from JSON to a type T with support for async converters.

SlySerialize.top_level.to_json(value: Any, converter: Converter[JsonType, Any] | None = None) JsonType#

Converts a value to JSON.