Fundamentals
    Preparing search index...

    Class JsonConverter<T>Abstract

    Base class for JSON converters that handle serialization and deserialization of specific types. Similar to System.Text.Json.Serialization.JsonConverter.

    Type Parameters

    • T = any

    Hierarchy (View Summary)

    Index
    • Determines whether the converter can convert the specified type.

      Parameters

      Returns boolean

      True if the converter can convert the type; otherwise, false.

      Not called by JsonSerializer and scheduled for removal in the next major version. A converter is resolved by the type it declares through type, which is what this would answer anyway, so overriding it has no effect - register a converter per type instead. Wiring it into the lookup is not the plan either: it would force a scan of every converter on the path taken by every plain object, to serve a case a second registration already covers.

    • Reads and converts the JSON to the target type.

      Parameters

      • value: any

        The value to deserialize.

      Returns T

      The deserialized value.

    • Writes the value as JSON.

      Parameters

      • value: T

        The value to serialize.

      Returns any

      The serialized value.