DuplicateFieldPolicy

What to do when an object is given the same field name twice.

The specification is unambiguous — "it is an error for an object to contain two fields with the same name" — so the encoder has to resolve the collision one way or the other before it writes.

Entries

Link copied to clipboard

The last occurrence wins, which is what JSON.parse, kotlinx-serialization and every SQL engine's JSON reader do. The default, because ingest should not fail on a document a browser would accept.

Link copied to clipboard

Reject the document. For callers that would rather hear about it than store one of two values.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.