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

Replace Jackson with kotlinx.serialization #117

Open
ArtificialPB opened this issue Apr 21, 2024 · 0 comments
Open

Replace Jackson with kotlinx.serialization #117

ArtificialPB opened this issue Apr 21, 2024 · 0 comments

Comments

@ArtificialPB
Copy link
Member

ArtificialPB commented Apr 21, 2024

Module

Other

📝 Description

Migrate to kotlinx.serialization, which supports kotlin multiplatform.

Use json-okio module in HttpClient to write content directly to request body. It might also make sense to consider implementing custom JsonWriter which supports serializing directly to ByteArray, instead of converting first to String. See: https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/json-okio/commonMain/src/kotlinx/serialization/json/okio/internal/OkioJsonStreams.kt#L37

Implement custom serializers and deserializers for common types: Address, Bytes, Hash, Bloom, Long (hex), Int (hex), BigInteger (hex). Covering the low-level types with custom serializers will make it easier to implement the top-level ones, e.g. RPCTransaction. If the performance is not good enough with compiler-generated top-level type serializers, implement custom serializers also for them.

Serializers: https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant