fix(signalr): fail to parse MessagePack-CSharp-Union | None type when protocol is msgpack
This commit is contained in:
@@ -242,7 +242,9 @@ class MsgpackProtocol:
|
|||||||
# except `X (Other Type) | None`
|
# except `X (Other Type) | None`
|
||||||
if NoneType in args and v is None:
|
if NoneType in args and v is None:
|
||||||
return None
|
return None
|
||||||
if not all(issubclass(arg, SignalRUnionMessage) for arg in args):
|
if not all(
|
||||||
|
issubclass(arg, SignalRUnionMessage) or arg is NoneType for arg in args
|
||||||
|
):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Cannot validate {v} to {typ}, "
|
f"Cannot validate {v} to {typ}, "
|
||||||
"only SignalRUnionMessage subclasses are supported"
|
"only SignalRUnionMessage subclasses are supported"
|
||||||
|
|||||||
Reference in New Issue
Block a user