Title: Theory / Unimportant / CS / Programming / Kotlin / Library / Serialization
On every note of this deck, unless a note says otherwise:
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md

Name: A serializer
Definition: The process in charge of serializing data

Name: Serializing an object
Definition: Converting an object into a serial sequence of its constituting primitive values

Name: Encoding a serialization of an object
Definition: Transforming a serialization of an object into the output format representation

Name: An encoder
Definition: The object doing the encoding step
Context: Serialization

Name: A decoder
Definition: The object doing the decoding of a serialized input
Context: Serialization

Name: A deserializer
Definition: The object doing the deserializion of a decoded input
Context: Serialization

Name: Decoding an input
Definition: A process taking an input and transforming it into a serial sequence of primitive values
Context: Serialization

Name: Deserializing an serial sequence of input
Definition: Transforming the serial sequence of input into an object
Context: Serialization

Question: How do kotlinx.serialization create deserialization
Answer: Adding to the class a private constructor used by the decode function
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Context: Serialization

Question: How to check that a deserialization leads to an acceptable value
Answer: Add the check in init {}
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Context: Serialization

Instruction: @Transient val
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Effect: The value must not be serialized
Language: kotlin
Context: kotlinx.serialization
Assuming: This value should have a default value

Instruction: @EncodeDefault val foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Meaning: serialize value foo even when it has the default value
Language: kotlin
Context: kotlinx.serialization

Instruction: @Required val foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Meaning: Reject deserialization if foo is not present
Language: kotlin
Context: kotlinx.serialization

Instruction: @Serializable class Foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Meaning: Allow to use kotlinx.serialization with class Foo
Language: kotlin
Context: kotlinx.serialization

Instruction: @EncodeDefault(mode) val foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Meaning: When foo's value is the default value, encode according to mode
Language: kotlin
Context: kotlinx.serialization

Question: What occurs if you serialize a value with cyclic reference
Answer: Stack overflow
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
Context: kotlinx.serialization

Instruction: @SerialName("foo") val bar
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md
https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/builtin-classes.md
Meaning: Same as val bar, but when serialized, its name is considered to be "foo"
Context: kotlinx.serialization
Assuming: Class is marked @Serializable

Question: The primitive serializable type in Kotlin
Answer: Enum (and so Unit)
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/builtin-classes.md
Context: kotlinx.serialization
Answer2: Boolean, Byte, Short, Int, Long, Float, Double, Char
Answer3: String

Name: A composite serializable type
Definition: A class composed of serializable types
Context: kotlinx.serialization

Typ: SerializationStrategy<in T>
Meaning: defines the serial form of a type T
Function: abstract fun serialize(encoder: Encoder, value: T)
Serializes the value of type T using the format that is represented by the given encoder.
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Function2: val descriptor: SerialDescriptor
Describes the structure of the serializable representation of T, that current deserializer is able to deserialize.
Context: kotlinx.serialization

Typ: DesrializationStrategy<T>
Meaning: defines the serial form of a type T, including its structural description, declared by the descriptor and the actual deserialization process, defined by the implementation of the deserialize method.
Function: fun deserialize(decoder: Decoder): T
Deserializes the value of type T using the format that is represented by the given decoder.
Page: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/
Function2: val descriptor: SerialDescriptor
Describes the structure of the serializable representation of T, that current deserializer is able to deserialize.
Context: kotlinx.serialization

Typ: Decoder
Meaning: a core deserialization primitive that encapsulates the knowledge of the underlying format and an underlying storage, exposing only structural methods to the deserializer, making it completely format-agnostic.
Page: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-deserialization-strategy/
Context: kotlinx.serialization

Typ: Encoder
Meaning: a core serialization primitive that encapsulates the knowledge of the underlying format and its storage, exposing only structural methods to the serializer, making it completely format-agnostic
Page: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization.encoding/-encoder/
Context: kotlinx.serialization

Typ: Encoder
Meaning: a core serialization primitive that encapsulates the knowledge of the underlying format and its storage, exposing only structural methods to the serializer, making it completely format-agnostic
Page: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization.encoding/-encoder/
Context: kotlinx.serialization
Language: Kotlin

Instruction: Class.serializer(t_1_serializer,..., t_n_serializer)
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Returns: The KSerializer<Class<T_1, ..., T_n>>
Variables: @Seriablizable class Class<T_1, ..., T_n>

Instruction: ListSerializer(class_serializer())
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Returns: A KSerializer<List<Class>>
Variables: @Seriablizable class Class

Instruction: SetSerializer(class_serializer())
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Returns: A KSerializer<Set<Class>>
Variables: @Seriablizable class Class

Instruction: MapSerializer(key_class_serializer, value_class_serializer)
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Returns: A KSerializer<Map<Key_class, Value_Class>>
Variables: @Seriablizable class Class

Typ: KSerializer<T>
Meaning: responsible for the representation of a serial form of a type T in terms of encoders and decoders and for constructing and deconstructing T from/to a sequence of encoding primitives.
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Extends: SerializationStrategy<T> , DeserializationStrategy<T>
Function3: nullable:
A KSerializer<T?>

Instruction: @Serializable(with = kserializer_Foo::class) class Foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Meaning: Define class Foo to be serializable with KSerializer kserializer_Foo
Context: kotlinx.serialization

Instruction: @file:UseSerializers(KSerializableForFoo::class)
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Effect: In this file, Foo is serializable with KSerilableForFoo
Language: Kotlin
Context: kotlinx.serialization

Question: How to make a class you don't own serializable
Answer: @file:UseSerializers(KSerializableForFoo::class)
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Context: kotlinx.serialization
Answer2: typealias FooSerializable = @Serializable(FooSerializer::class) Foo
Answer3: Context, through SerializersModule

Instruction: @Contextual val foo
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Meaning: foo is serializable, serializer should be taken from the context passed in the encode/decode function
Context: kotlinx.serialization

Instruction: SerializersModule {
  contextual(Foo_1_Serializer)
  ...
  contextual(Foo_n_Serializer)
}
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
Effect: A serializer context in which we use the Foo_i_Serializer to serialize types
Context: kotlinx.serialization

Instruction: TODO: polymormhism and later classes
Page: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/polymorphism.md
Context: kotlinx.serialization