Stable release & move to Retrofit repo
See original GitHub issueHi! As far as I understood from #43 the last thing that prevents this lib from being an official converter in the Retrofit repo is that it depends on the experimental parts of kotlinx.serialization API.
We’ve removed experimentality from StringFormat/BinaryFormat in 1.3.0 release. Am I right that serializer(java.lang.Type)
is the only experimental function blocking this?
If so, can you please provide some feedback on it — whether it does the right thing, or some functionality is missing, etc. We’re going to stabilize it soon so converters like this can depend on a stable API.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
square/retrofit: A type-safe HTTP client for Android and the JVM
Retrofit. A type-safe HTTP client for Android and Java. For more information please see the website. Download. Download the latest JAR or grab...
Read more >Using Retrofit 2.x as REST client - Tutorial - Vogella.com
Retrofit is a REST Client for Java and Android allowing to retrieve and upload JSON (or other structured data) via a REST based...
Read more >Consuming APIs with Retrofit | CodePath Android Cliffnotes
Retrofit is a type-safe REST client for Android, Java and Kotlin developed by Square ... Assuming you have the JSON response already, go...
Read more >Retrofit 2.0: The biggest update yet on the best HTTP Client ...
Until last week, Retrofit 2.0 just passed its Release Candidate stage to Beta 1 and has been publicly launched to everyone.
Read more >No more Retrofit, move to Ktor on Android | by Barros - Medium
Waiting for the stable release of KMM (Kotlin Multiplatform Mobile) it could be useful starting to use this library instead of Retrofit.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks! I’m going to release a stable version of this library for simplicity, and then will migrate it to Retrofit for its next release.
We’ve been revisiting the design, and while the function is likely to stay, I’d like to ask about the problems with nullability:
Because Java’s type tokens do not contain this information,
serializer(Type)
always returns non-nullable serializers for all nested types. In practice, this means the following code:Would fail with deserialization error on the input like
["a", null]
. Have you experienced this problem? How severe is it for you?We currently have several proposals on what to do with it:
.nullable
inside this function. This would make this function unusable for formats that strictly differentiate nullable vs non-nullable: while Json format can deserialize non-null value with nullable deserializer, Protobuf can’t.serializer(type: Type, wrapIntoNullable: Boolean)
or more sophisticatedserializer(type: Type, typeArgSerializerFactory: (Type) -> KSerializer<*>)
(latter would also probably cover https://github.com/Kotlin/kotlinx.serialization/issues/2025).