-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: bugA general bugA general bug
Milestone
Description
In KotlinSerializationSupport
:
@Nullable
protected final KSerializer<Object> serializer(ResolvableType resolvableType) {
Type type = resolvableType.getType();
KSerializer<Object> serializer = serializerCache.get(type);
if (serializer == null) {
try {
serializer = SerializersKt.serializerOrNull(type);
}
catch (IllegalArgumentException ignored) {
}
if (serializer != null) {
if (hasPolymorphism(serializer.getDescriptor(), new HashSet<>())) {
return null;
}
serializerCache.put(type, serializer);
}
}
return serializer;
}
the call serializer = SerializersKt.serializerOrNull(type);
generates an instance of EmptySerializersModule()
which - by definition - does not contain any information about custom serializers. Using format.getSerializersModule().serializerOrNull()
would allow the Kotlin serialization in WebFlux to use custom serializers for third-party classes as is possible for WebMVC's Kotlin serialization implementation.
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: bugA general bugA general bug