diff --git a/aries_cloudagent/protocols/routing/messages/forward.py b/aries_cloudagent/protocols/routing/messages/forward.py index da5e2e8b67..7324cee77e 100644 --- a/aries_cloudagent/protocols/routing/messages/forward.py +++ b/aries_cloudagent/protocols/routing/messages/forward.py @@ -19,7 +19,7 @@ class Meta: message_type = FORWARD schema_class = "ForwardSchema" - def __init__(self, *, to: str = None, msg: str = None, **kwargs): + def __init__(self, *, to: str = None, msg: dict = None, **kwargs): """ Initialize forward message object. @@ -41,4 +41,4 @@ class Meta: model_class = Forward to = fields.Str(required=True) - msg = fields.Str(required=True) + msg = fields.Dict(required=True) diff --git a/aries_cloudagent/protocols/routing/messages/tests/test_forward.py b/aries_cloudagent/protocols/routing/messages/tests/test_forward.py index 79cd74577b..9c14457721 100644 --- a/aries_cloudagent/protocols/routing/messages/tests/test_forward.py +++ b/aries_cloudagent/protocols/routing/messages/tests/test_forward.py @@ -37,7 +37,7 @@ def test_serialize(self, message_schema_dump): class TestForwardSchema(TestCase): def test_make_model(self): - message = Forward(to="to", msg="msg") + message = Forward(to="to", msg={"some": "msg"}) data = message.serialize() model_instance = Forward.deserialize(data) assert isinstance(model_instance, Forward) diff --git a/aries_cloudagent/transport/pack_format.py b/aries_cloudagent/transport/pack_format.py index 75ba6b04bd..40ea2f39cf 100644 --- a/aries_cloudagent/transport/pack_format.py +++ b/aries_cloudagent/transport/pack_format.py @@ -177,6 +177,7 @@ async def pack( if routing_keys: recip_keys = recipient_keys for router_key in routing_keys: + message = json.loads(message.decode("utf-8")) fwd_msg = Forward(to=recip_keys[0], msg=message) # Forwards are anon packed recip_keys = [router_key]