https://kotlinlang.org logo
#moko
Title
# moko
m

Michal Harakal

08/25/2021, 2:16 PM
Hello, I didn't find anything how to deserialize timestamps. Currently generated models converts date time as String. (e.g. like it is defined here https://github.com/bundesAPI/autobahn-api/blob/main/openapi.yaml#L417) Do I miss something? I do remember, that with the plain OpenApi plugin I could define date time library explicitly. For KMP I think a
kotlinx.datetime.LocalDate
could be taken by default. Of course there is no deal to do date conversion during DTO=>domain mapping. Any thoughts on this ?
🤔 1
a

alex009

09/06/2021, 5:33 AM
hi! now out of box not supported any date-time conversion. you can just add extension property to generated entity for example:
Copy code
val MyEntity.createdAtDT: DateTime get() = parse createdAt string to DateTime by your library
sry for late reply 😞
🙏 1
2 Views