-
Notifications
You must be signed in to change notification settings - Fork 356
Refine support for kotlinx.serialization when reflection is involved #1410
Comments
I will add those few hints, but maybe worth to raise it on Kotlin side as well to see if |
Thanks! It seems that the reflection is necessary: Kotlin/kotlinx.serialization#1125 (comment) |
Yeah, seems to require Kotlin/kotlinx.serialization#1348 which has not yet been implemented. |
@jamesward I would like to reproduce the issue in one of our sample, but webmvc-kotlin is already using kotlinx.serialization without the need for additional configuration. Any chance you could share a reproducer or send a quick PR that modifies |
I put together a reproducer:
One key thing that was exposed by the reproducer is that there is something with the use of |
Thank you so much for the repro @jamesward, this is super useful. When running repro with
So when defining
But on after being processed AOT by the Kotlin compiler, it looks like that:
When I debug @christophstrobl @mp911de I am wondering if we should refine
|
I'm not sure that's the right entry-point. Kotlin serialization is not a Spring Data concern but a cross-cutting one originating from Instead, it would make sense to come up with a dedicated component that adds such hints ideally on the Framework level. Otherwise, if every individual component starts adding the same serialization type hints we quickly end up with a ton of duplications and potentially code that behaves slightly different creating an unpleasant experience for users. |
Good point, we will have a deeper look on Framework side if we can refine the Kotlin support for such use case. cc @poutsma |
It worked without the |
Now that Spring Boot supports kotlinx.serialization it'd be great to have the native hints to support it. I have:
Not sure why the
Object
one is needed but it seems strange.The text was updated successfully, but these errors were encountered: