KotlinxSerializer only supports last registered list
See original GitHub issueKotlinxSerializer only supports the last registered list.
Each time a new list is registered (i.e MyObject.serializer().list
), it replaces the previously registered list.
I have a project with failing test cases here: https://github.com/keiththompson/KotlinxSerializer-Bug
Ktor Version: 1.0.0 Client: OkHttp OS: MacOS JVM:
/usr/libexec/java_home -V
Matching Java Virtual Machines (1):
1.8.0_144, x86_64: "Java SE 8"
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Content negotiation and serialization | Ktor
Serializing/deserializing the content in a specific format when sending requests and receiving responses. Ktor supports the following formats ...
Read more >JSON Serialization in Ktor. Introduction | Nerd For Tech
util.ArrayList, you should probably use List instead of ArrayList (Moshi only supports the collection interfaces by default) or else register a ...
Read more >Ktor: Serialize/Deserialize JSON with List as root in Multiplatform
Works only if you register only one list serializer. When there are more, KotlinxSerializer.lookupSerializerByType() doesn't distinguish between ...
Read more >Serialization | Kotlin
You can find the complete list of supported serialization formats below. ... Check out the releases on GitHub to find the latest versions....
Read more >Kotlin Multiplatform for iOS Developers - InfoQ
KMP is not the final step to accomplishing 100% shared code across all platforms ... Trying to minimize repetition is just good programming....
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 FreeTop 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
Top GitHub Comments
Hi, @keiththompson thanks for the report. It’s a known issue. The serializers registered by the target
KClass
object and it is the same for all lists:List<*>
. There is no classType
in kotlin-native and kotlin-js for now, so theKClass
is the only one possible key.If you have any thoughts about a possible solution you could share it with us. btw. PRs are always welcome 😃
This problem is not fixed: https://github.com/ktorio/ktor/issues/969
I might be wrong, leaving this here for reference
(UPDATE: it’s fixed on 1.3.0) 🎉