ktor
ktor copied to clipboard
Data conversion with generic
Ktor Version
1.1.2
Hello! I have a problem with DataConversion if it used with generic.
For example my url looks like this
/test?ids=1,2,3
I try to do smt like this
@Location("/test") class Test(val ids: <List<Long>> = ArrayList())
And try to use custom conversion
install(DataConversion) { convert(List<Long>) { decode { values, _ -> // some logic } encode { value -> // some logic } } }
But in runtime there is type erasure, so custom converters contains just java.util.List
, but type is java.util.List<java.Lang.Long>
so my custom converter never used and DataConversion always try to use DefaultConversionService. So maybe there is some solutions for this case? Thx!
@cy6erGn0m Do you have any explanation about this?
Hello! I have the same problem with desirialization String to WrappedObjectId<Any>. It is a part of Kmongo driver.
Any news ?
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.