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
How to create custom Serializer for PersistentList? #1908
Comments
If you're using KAPT, then it's #685 |
I stumbled upon the same issue, and removing the type parameter from the class name and explicitly specifying a type for the rest solved it for me.
|
So, you would have to create an individual custom serializer for each type of PersistentList, instead of using the generics? |
So, you would have to create an individual custom serializer for each type of PersistentList, instead of using the generics? |
I suppose. I just needed it for one type of Persistent List, so for me that didn't matter, but a better solution should be possible |
I don’t know how to make them generic, do you?
… On Feb 21, 2023, at 5:23 PM, Simon Alveteg ***@***.***> wrote:
So, you would have to create an individual custom serializer for each type of PersistentList, instead of using the generics?
I suppose. I just needed it for one type of Persistent List, so for me that didn't matter, but a better solution should be possible
—
Reply to this email directly, view it on GitHub <#1908 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHLEYWL52OLY54IJUTTFN3WYVE5TANCNFSM5T6TPGEA>.
You are receiving this because you commented.
|
I don't, the code I posted is a modified version of the code in this issue: You've probably seen both of those links before, but I'm afraid I can't be of more help than that |
Idk... from what I can see its not clear to be that kotlinx serialization supports generics.
But since I have no need for generic use case (its easy enough to make a serializer for each data class that I need in my app), Im going to end my investigations here, unless you have any better ideas?
Best,
Chris
… On Feb 23, 2023, at 7:45 AM, Simon Alveteg ***@***.***> wrote:
I don't, the code I posted is a modified version of the code in this issue:
#1114 <#1114>
and I remember reading this medium article when I worked on the project that needed serialization:
https://medium.com/androiddevelopers/datastore-and-kotlin-serialization-8b25bf0be66c
You've probably seen both of those links before, but I'm afraid I can't be of more help than that
—
Reply to this email directly, view it on GitHub <#1908 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABHLEYQ2XWFS7TNXTQZPTOLWY5SYFANCNFSM5T6TPGEA>.
You are receiving this because you commented.
|
I have a list of classes and I need to save it into my datastore, probably related to issue #635.
The code is like so:
and my subclass:
But I got a warning when tried to serialize
How to solve this problem? Thanks in advance.
The text was updated successfully, but these errors were encountered: