Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/kotlinx.serialization #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

floschu
Copy link
Contributor

@floschu floschu commented Jun 1, 2019

Removed Gson and instead added kotlinx.serialization

@Quadrox
Copy link

Quadrox commented Jun 3, 2019

Does kotlinx.serialization have a better performance than Gson?
Are there some benchmarks?

Or why do you want to switch at all?

@floschu
Copy link
Contributor Author

floschu commented Jun 3, 2019

In general I think if kotlin provides a standard way of serialisation and deserialisation, it should be used over a third party library like Gson.
According to benchmarks linked in this issue the scores are at least similar if not better than Gson.

@AlexGrafl
Copy link

Improvement: Add an example for custom (de-)serialization (https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/custom_serializers.md) i.e. Dates

val regionalBlocs: List<RemoteRegionalBloc>,
val cioc: String
)
val timezones: List<@ContextualSerialization ZoneOffset?>
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding a nullable Serializer

floschu and others added 4 commits June 6, 2019 16:43
…into refactor/kotlinx.serialization

# Conflicts:
#	core/src/main/kotlin/com/tailoredapps/countriesexample/core/remote/serializer/ZoneOffsetSerializer.kt
FlowMo7
FlowMo7 previously approved these changes Jun 7, 2019
import org.threeten.bp.ZoneOffset

@ImplicitReflectionSerializer
class CustomSerializerTest : AutoCloseKoinTest() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice test 👍

import org.threeten.bp.ZoneOffset

@Serializer(forClass = ZoneOffset::class)
object ZoneOffsetSerializer : KSerializer<ZoneOffset?> {

Choose a reason for hiding this comment

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

@floschu floschu added the don't merge Do not merge this. Might not yet be finished or whatever label Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
don't merge Do not merge this. Might not yet be finished or whatever
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants