MissingFieldException

class MissingFieldException(    missingFields: List<String>,     message: String?,     cause: Throwable?) : SerializationException

Thrown when KSerializer did not receive a non-optional property from CompositeDecoder and CompositeDecoder.decodeElementIndex had already returned CompositeDecoder.DECODE_DONE.

MissingFieldException is thrown on missing field from all auto-generated serializers and it is recommended to throw this exception from user-defined serializers.

See also

Constructors

Link copied to clipboard
fun MissingFieldException(missingFields: List<String>, serialName: String)

Creates an instance of MissingFieldException for the given missingFields and serialName of the corresponding serializer.

Link copied to clipboard
fun MissingFieldException(missingField: String, serialName: String)

Creates an instance of MissingFieldException for the given missingField and serialName of the corresponding serializer.

Link copied to clipboard
fun MissingFieldException(    missingFields: List<String>,     message: String?,     cause: Throwable?)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?
Link copied to clipboard
val missingFields: List<String>

List of fields that were required but not found during deserialization. Contains at least one element.