Skip to content

Conversation

@daniCsorbaJB
Copy link

This is the third part of the Kotlin Serialization rewrite.

Related YouTract ticket is: KT-80887 [Docs] Create a serialize built-in classes guide for kotlinx.serialization

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've added some comments. One thing to be clear about is the distinction between json and serialization in general. Json as example is good, but I would avoid giving the impression that serialization is json-only.

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

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

see comments

Copy link
Member

@sandwwraith sandwwraith left a comment

Choose a reason for hiding this comment

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

.

```
{kotlin-runnable="true"}

Similarly, Kotlin's [`Instant`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-instant/) type
Copy link
Member

Choose a reason for hiding this comment

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

I explicitly mentioned that here should be Kotlin 2.2 requirement, as we do not version our docs and someone may open this section with the old Kotlin and get frustration because nothing is working.

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 page! Only a few clarification questions or suggestions from me. Can you add IDs to all your runnable samples so that we can track them in GA? 😃

### Unsigned numbers

Kotlin serialization supports Kotlin's [unsigned integer types](unsigned-integer-types.md) like `UByte` and `UInt`.
In JSON, these values are serialized as regular JSON numbers and preserve their full unsigned range:

Choose a reason for hiding this comment

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

What do you think about "retain" instead of "preserve"?

Copy link
Author

Choose a reason for hiding this comment

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

I think I prefer preserve here slightly.
Retain to me is more like is more retain a state/ continue to exist. s

“preserve” feels closer to what's happening here maintain integrity / fidelity across a transformation.

{style="note"}

#### Deserialization behavior of collections

Choose a reason for hiding this comment

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

Missing an intro here :)

Copy link
Author

Choose a reason for hiding this comment

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

😱 re-added it — nice catch


## What's next

* 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.

Similar comment to the get started PR about whether this is an actual page or a section within the page.

Copy link
Author

Choose a reason for hiding this comment

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

good point! 👍 removed it

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.

5 participants