kotlinx-serialization / kotlinx.serialization.builtins / AbstractDecoder / beginStructure

beginStructure

(common, js, jvm, native) open fun beginStructure(descriptor: SerialDescriptor, vararg typeParams: KSerializer<*>): CompositeDecoder

Decodes the beginning of the nested structure in a serialized form and returns CompositeDecoder responsible for decoding this very structure.

Typically, classes, collections and maps are represented as a nested structure in a serialized form. E.g. the following JSON

{
    "a": 2,
    "b": { "nested": "c" }
    "c": [1, 2, 3],
    "d": null
}

has three nested structures: the very beginning of the data, "b" value and "c" value.