Closed acruise closed 5 months ago
Provide a simple example - I try to fix this.
@acruise thanks for raising this issue. Can you provide a small code (i.e. a failing unit test) so we can work on a solution more easily?
Just a side note. Regarding performances, you should use @useserializer instead of contextual, because contextual is resolving the serializer at runtime, while @useserializer is resolved at compile time!
Done in #183
Hey folks, this library looks pretty good so far, but I'm running into one awkwardness around Map properties keyed by something other than
String
.When the key type is a
data class
in my own codebase, I can annotate it with a serializer with a primitive descriptor, and avro4k is happy to use that. But for an external type, I'd like to be able to have properties likeMap<@Contextual SomethingExternal, Foo>
and have avro4k look up the serializer forSomethingExternal
dynamically from context, but it doesn't seem to do so.I can set
@file:UseSerializers
on the file, but I'd rather use@Contextual
. Thanks!