summaryrefslogtreecommitdiff
path: root/modules/rpc/jsonrpc.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-02-24 03:21:42 +0000
committerSadie Powell <sadie@witchery.services>2025-02-24 03:41:06 +0000
commita111b40560bf305653b07d8f7289484793a32588 (patch)
treeb90c6a1070120b5115641414ac2c806efde7c8fa /modules/rpc/jsonrpc.cpp
parent2ccd182d2e6689877eba911452eaa8a06e82ac0b (diff)
Allow use of a non-map type as the root RPC element.
Diffstat (limited to 'modules/rpc/jsonrpc.cpp')
-rw-r--r--modules/rpc/jsonrpc.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/rpc/jsonrpc.cpp b/modules/rpc/jsonrpc.cpp
index ad46bcb13..22c00b118 100644
--- a/modules/rpc/jsonrpc.cpp
+++ b/modules/rpc/jsonrpc.cpp
@@ -171,10 +171,9 @@ public:
else
yyjson_mut_obj_add_strn(doc, root, "id", request.id.c_str(), request.id.length());
- if (!request.GetReplies().empty())
+ if (request.GetRoot())
{
- auto *result = yyjson_mut_obj(doc);
- SerializeMap(doc, result, request);
+ auto *result = SerializeElement(doc, request.GetRoot().value());
yyjson_mut_obj_add_val(doc, root, "result", result);
}