-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
core/src/main/kotlin/com/tailoredapps/countriesexample/core/remote/RemoteModule.kt
Show resolved
Hide resolved
Does kotlinx.serialization have a better performance than Gson? Or why do you want to switch at all? |
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. |
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?> |
There was a problem hiding this comment.
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
…pecific Serializer class
…into refactor/kotlinx.serialization # Conflicts: # core/src/main/kotlin/com/tailoredapps/countriesexample/core/remote/serializer/ZoneOffsetSerializer.kt
core/src/main/kotlin/com/tailoredapps/countriesexample/core/remote/model/RemoteCountry.kt
Outdated
Show resolved
Hide resolved
import org.threeten.bp.ZoneOffset | ||
|
||
@ImplicitReflectionSerializer | ||
class CustomSerializerTest : AutoCloseKoinTest() { |
There was a problem hiding this comment.
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?> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Gson and instead added kotlinx.serialization