How to serialize form-data using kotlinx-serializa...
# server
m
How to serialize form-data using kotlinx-serialization
👀 2
c
I wrote an internal library to *de*serialize the
x-www-form-urlencoded
body from
POST
requests sent by browser on form submit into a
FormDto
data class object. It uses Jackson (JSON lib for the JVM) as it has really good type coercion features (in the
x-www-form-urlencoded
body everything is a string, in the
FormDto
data class object we have specific types: Long, Int, Enum, Boolean, String, some sub-FormDto data class and collections of the aforementioned). Works like a charm! (more lines of test than lines of actual lib code)