From e07d826e0ebd9507793fe033236e5f0f12ba5732 Mon Sep 17 00:00:00 2001 From: Shuvam Pandey Date: Fri, 14 Aug 2026 16:25:40 +0200 Subject: [PATCH] rpc: Fix type in ApplyTypeStrOverride This should be an integer, not a numeric, as already enforced by the RPC code and described in the mapping just above the changed line. --- src/rpc/server.cpp | 2 +- test/functional/rpc_openrpc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 5f3bf91683b..1bc8933e624 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -311,7 +311,7 @@ void ApplyTypeStrOverride(UniValue& schema, const RPCArg& arg) }; if (number_or_string.contains(type_label)) { UniValue one_of{UniValue::VARR}; - one_of.push_back(MakeObject({{"type", "number"}})); + one_of.push_back(MakeObject({{"type", "integer"}})); one_of.push_back(MakeObject({{"type", "string"}})); schema = UniValue{UniValue::VOBJ}; schema.pushKV("oneOf", std::move(one_of)); diff --git a/test/functional/rpc_openrpc.py b/test/functional/rpc_openrpc.py index 5a57e6251ad..32be191f58f 100755 --- a/test/functional/rpc_openrpc.py +++ b/test/functional/rpc_openrpc.py @@ -52,7 +52,7 @@ class OpenRPCDocTest(BitcoinTestFramework): self.log.info("Checking type_str override schemas") getblockstats = find_method(openrpc, "getblockstats") hash_or_height = find_param(getblockstats, "hash_or_height") - assert_equal(hash_or_height["schema"], {"oneOf": [{"type": "number"}, {"type": "string"}]}) + assert_equal(hash_or_height["schema"], {"oneOf": [{"type": "integer"}, {"type": "string"}]}) self.log.info("Checking fixed-length array schemas") deriveaddresses = find_method(openrpc, "deriveaddresses")