Skip to content

Conversation

daniCsorbaJB
Copy link

@daniCsorbaJB daniCsorbaJB commented Apr 10, 2025

This PR is for the first batch of documentation updates for KT-79623 [Docs][Libraries] Serialization introduction

Copy link
Contributor

@pdvrieze pdvrieze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to be accurate in how serialization works. The "intermediate data" representation is misleading, an intermediate format is fundamentally impossible (even without supporting format specific escape hatches such as JsonPolymorphicSerializer)


## Kotlin serialization libraries

The `kotlinx.serialization` library offers support for all platforms, including JVM, JavaScript, Native.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worthwhile to clarify more that the serialization library provides the format agnostic infrastructure. Then the -json and -cbor libraries are format implementations (they are fundamentally different and are independent even though first-party).

Copy link
Contributor

@pdvrieze pdvrieze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some further comments. It may be that some of them are better used in other pages (not in this request)

@daniCsorbaJB daniCsorbaJB changed the base branch from master to doc-restructuring-master July 31, 2025 13:56
@daniCsorbaJB daniCsorbaJB force-pushed the doc-restructuring-updates-1 branch from 4e69cdf to 85abee7 Compare August 1, 2025 06:07
@daniCsorbaJB daniCsorbaJB marked this pull request as ready for review August 1, 2025 07:57
@sarahhaggarty sarahhaggarty self-assigned this Aug 14, 2025
Copy link

@sarahhaggarty sarahhaggarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!
I have some suggestions to make it more polished 🚀

[//]: # (title: Serialization)

**Serialization** is the process of converting data used by an application to a format that can be transferred over a
network or stored in a database or a file. Deserialization is the opposite process of converting external data back into a runtime object.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
network or stored in a database or a file. Deserialization is the opposite process of converting external data back into a runtime object.
network, or stored in a database or a file. Deserialization is the opposite process of converting external data back into a runtime object.

network or stored in a database or a file. Deserialization is the opposite process of converting external data back into a runtime object.
Together, they are essential to most applications that exchange data with third parties.

Some data serialization formats, such as [JSON](https://www.json.org/json-en.html) and [Protocol Buffers](https://protobuf.dev/) are particularly common.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some data serialization formats, such as [JSON](https://www.json.org/json-en.html) and [Protocol Buffers](https://protobuf.dev/) are particularly common.
Some data serialization formats, such as [JSON](https://www.json.org/json-en.html) and [Protocol Buffers](https://protobuf.dev/), are particularly common.

Together, they are essential to most applications that exchange data with third parties.

Some data serialization formats, such as [JSON](https://www.json.org/json-en.html) and [Protocol Buffers](https://protobuf.dev/) are particularly common.
Being language-neutral and platform-neutral, these formats enable data exchange between systems written in any modern language.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Being language-neutral and platform-neutral, these formats enable data exchange between systems written in any modern language.
These formats are language- and platform-neutral, so you can use them to exchange data between systems written in any modern language.

I think this reads more clearly if we talk about formats first. WDYT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍


## Kotlin serialization libraries

The `kotlinx.serialization` library offers support for all platforms, including JVM, JavaScript, Native.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `kotlinx.serialization` library offers support for all platforms, including JVM, JavaScript, Native.
The `kotlinx.serialization` libraries offer support for all platforms, including the JVM, JavaScript, and Native platforms.

* [Properties](https://en.wikipedia.org/wiki/.properties): [`kotlinx-serialization-properties`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#properties)
* [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md): [`kotlinx-serialization-hocon`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#hocon) (only on JVM)

All libraries except JSON serialization (`kotlinx-serialization-json`) are [experimental](components-stability.md), which means their API can be changed without notice.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All libraries except JSON serialization (`kotlinx-serialization-json`) are [experimental](components-stability.md), which means their API can be changed without notice.
All libraries, except for JSON serialization (`kotlinx-serialization-json`), are [Experimental](components-stability.md). Their APIs might change at any time.

## What's next

* Learn the basics of Kotlin serialization in the [Get started with serialization tutorial](serialization-get-started.md).
* See how the `kotlinx.serialization` library processes [primitives, collections, and other built-in types](serialization-serialize-builtin-types.md)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* See how the `kotlinx.serialization` library processes [primitives, collections, and other built-in types](serialization-serialize-builtin-types.md)
* See how the `kotlinx.serialization` libraries process [primitives, collections, and other built-in types](serialization-serialize-builtin-types.md)


* Learn the basics of Kotlin serialization in the [Get started with serialization tutorial](serialization-get-started.md).
* See how the `kotlinx.serialization` library processes [primitives, collections, and other built-in types](serialization-serialize-builtin-types.md)
* To explore more complex JSON serialization scenarios, see [JSON serialization overview](configure-json-serialization.md).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* To explore more complex JSON serialization scenarios, see [JSON serialization overview](configure-json-serialization.md).
* Explore more complex JSON serialization scenarios in the [JSON serialization overview](configure-json-serialization.md).

* Learn the basics of Kotlin serialization in the [Get started with serialization tutorial](serialization-get-started.md).
* See how the `kotlinx.serialization` library processes [primitives, collections, and other built-in types](serialization-serialize-builtin-types.md)
* To explore more complex JSON serialization scenarios, see [JSON serialization overview](configure-json-serialization.md).
* Dive into the [Serialize classes](serialization-customization-options.md) section to learn how to serialize classes and how to modify the default behavior of the `@Serializable` annotation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Dive into the [Serialize classes](serialization-customization-options.md) section to learn how to serialize classes and how to modify the default behavior of the `@Serializable` annotation.
* Dive into [Serialize classes](serialization-customization-options.md) to learn how to serialize classes and modify the default behavior of the `@Serializable` annotation.

Copy link

@sarahhaggarty sarahhaggarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Just one last suggestion. LGTM! 🚀

Comment on lines 42 to 46
| [JSON](https://www.json.org/json-en.html) | [`kotlinx-serialization-json`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#json) | all supported platforms | Stable |
| [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) | [`kotlinx-serialization-hocon`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#hocon) | JVM only | Experimental |
| [Protocol Buffers](https://protobuf.dev/) | [`kotlinx-serialization-protobuf`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#protobuf) | all supported platforms | Experimental |
| [CBOR](https://cbor.io/) | [`kotlinx-serialization-cbor`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#cbor) | all supported platforms | Experimental |
| [Properties](https://en.wikipedia.org/wiki/.properties) | [`kotlinx-serialization-properties`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#properties) | all supported platforms | Experimental |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| [JSON](https://www.json.org/json-en.html) | [`kotlinx-serialization-json`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#json) | all supported platforms | Stable |
| [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) | [`kotlinx-serialization-hocon`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#hocon) | JVM only | Experimental |
| [Protocol Buffers](https://protobuf.dev/) | [`kotlinx-serialization-protobuf`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#protobuf) | all supported platforms | Experimental |
| [CBOR](https://cbor.io/) | [`kotlinx-serialization-cbor`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#cbor) | all supported platforms | Experimental |
| [Properties](https://en.wikipedia.org/wiki/.properties) | [`kotlinx-serialization-properties`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#properties) | all supported platforms | Experimental |
| [JSON](https://www.json.org/json-en.html) | [`kotlinx-serialization-json`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#json) | All supported platforms | Stable |
| [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) | [`kotlinx-serialization-hocon`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#hocon) | JVM only | Experimental |
| [Protocol Buffers](https://protobuf.dev/) | [`kotlinx-serialization-protobuf`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#protobuf) | All supported platforms | Experimental |
| [CBOR](https://cbor.io/) | [`kotlinx-serialization-cbor`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#cbor) | All supported platforms | Experimental |
| [Properties](https://en.wikipedia.org/wiki/.properties) | [`kotlinx-serialization-properties`](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/README.md#properties) | All supported platforms | Experimental |

@daniCsorbaJB daniCsorbaJB merged commit 9315ad5 into doc-restructuring-master Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants