Skip to content

How to de/serialize types? #36

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

Closed
wellingtoncosta opened this issue Aug 14, 2020 · 9 comments
Closed

How to de/serialize types? #36

wellingtoncosta opened this issue Aug 14, 2020 · 9 comments

Comments

@wellingtoncosta
Copy link

I trying to use this library, and I would like to know how to de/serialize types e.g. LocalDate, LocalDateTime.

@ilya-g
Copy link
Member

ilya-g commented Aug 14, 2020

I'd recommend using kotlinx.serialization.
We have plans to provide some ready to use serializers in future.

@wellingtoncosta
Copy link
Author

Yeah. I'm using kotlinx.serialization, and I found a way to de/serialize the mentioned types by using custom serializers.

@qrezet
Copy link

qrezet commented Mar 2, 2021

hi @wellingtoncosta, can you share your custom serializer for DateTime?

@wellingtoncosta
Copy link
Author

@qrezet I wrote this custom de/serializer in a private project of my previous company. I'll try to get this piece of code.

@qrezet
Copy link

qrezet commented Mar 3, 2021

@wellingtoncosta Thanks in advance!

@dkhalanskyjb
Copy link
Collaborator

@qrezet if you need serializers urgently, you may want to have a look at this PR: #101 If everything goes well, they will be available in the next release in some form.

@qrezet
Copy link

qrezet commented Mar 15, 2021

@dkhalanskyjb Awesome! Thanks for the update!

@qrezet
Copy link

qrezet commented Apr 13, 2021

Hi @dkhalanskyjb, if I'm not mistaken, this has already been part of the latest Ktor release right? 1.5.3?

@dkhalanskyjb
Copy link
Collaborator

Hi @qrezet, not sure what you mean, Ktor is not even integrated with the datetime library. It does have support for serialization but, as far as I know, does not provide any serializers of its own.

Also, the PR was merged, so the serializers for kotlinx-datetime are in the main branch now!

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

No branches or pull requests

4 participants