MissingFieldException

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.

MissingFieldException is constructed from the following properties:

See also

Constructors

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

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

constructor(missingField: String, serialName: String)

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

constructor(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

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