GH-660 Add initial suppport for sending/receiving Messages
Resolves #660
This commit is contained in:
@@ -314,10 +314,11 @@ public final class FunctionTypeUtils {
|
||||
if (isPublisher(type)) {
|
||||
type = getImmediateGenericType(type, 0);
|
||||
}
|
||||
if (type instanceof ParameterizedType && TypeResolver.resolveRawClass(type, null) != Message.class) {
|
||||
|
||||
if (type instanceof ParameterizedType && !Message.class.isAssignableFrom(TypeResolver.resolveRawClass(type, null))) {
|
||||
type = getImmediateGenericType(type, 0);
|
||||
}
|
||||
return TypeResolver.resolveRawClass(type, null) == Message.class;
|
||||
return Message.class.isAssignableFrom(TypeResolver.resolveRawClass(type, null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,7 +87,15 @@ public abstract class JsonMapper {
|
||||
return (T) json;
|
||||
}
|
||||
}
|
||||
return this.doFromJson(json, type);
|
||||
if (json instanceof String && !isJsonString(json) && (String.class == type || byte[].class == type)) {
|
||||
return String.class == type ? (T) json : (T) ((String) json).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
// if (String.class == type && json instanceof String && !isJsonString(json)) {
|
||||
// return (T) json;
|
||||
// }
|
||||
else {
|
||||
return this.doFromJson(json, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user