jooby
jooby copied to clipboard
Add type to MessageEncoder
The MessageDecoder
interface provides a type
parameter, which makes sense since it is impossible to know what to decode into otherwise.
The MessageEncoder
, however, does not have the type
param. The docs for message encoding assumes that the JSON library used knows how to handle the result
, which is of type Object
. This is true for gson
and jackson
, but when using kotlinx.serialization
I get issues when trying to encode for example ArrayLists
due to type erasure.
Would it be possible (and make sense) to add a type
parameter to MessageEncoder
?