Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DIDComm RPC response to permit empty lists or objects #117

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpc/rpc/v1_0/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def handle(self, context: RequestContext, responder: BaseResponder):
response_record = await DRPCRecord.retrieve_by_connection_and_thread(
session, connection_id, thread_id
)
response_record.response = context.message.response.serialize()
response_record.response = context.message.response
response_record.state = DRPCRecord.STATE_COMPLETED
serialized_response_record = response_record.serialize()

Expand Down
4 changes: 2 additions & 2 deletions rpc/rpc/v1_0/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ class Response(fields.Field):
def load_response_or_error(self, value):
"""Load RPC response or error."""

return RPCResponseModelSchema().load(value) if value else None
return RPCResponseModelSchema().load(value) if value is not None else None

def dump_response_or_error(self, value):
"""Dump RPC response or error."""

return RPCResponseModelSchema().dump(value) if value else None
return RPCResponseModelSchema().dump(value) if value is not None else None

def _serialize(self, value, attr, obj, **kwargs):
"""Serialize RPC response or error."""
Expand Down
Loading