diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-25 20:42:49 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-01-05 11:30:20 +0100 |
commit | 6f1c76ae14c884c919db9ed720c7776aa0748244 (patch) | |
tree | a67faa852cb940ff4503ffe639c9cd92e3810d29 /src/rpc/server.h | |
parent | 5865d41f889d326b51fb0b68be9a41c46d6cad83 (diff) |
rpc: Support named arguments
The [JSON-RPC specification](http://www.jsonrpc.org/specification) allows passing parameters as an Array, for by-position
arguments, or an Object, for by-name arguments.
This implements by-name arguments, but preserves full backwards compatibility. API using by-name arguments are
easier to extend, and easier to use (no need to guess which argument goes where).
Named are mapped to positions by a per-call structure, provided through the RPC command table.
Missing arguments will be replaced by null, except if at the end, then the argument is left out completely.
Currently calls fail (though not crash) on intermediate nulls, but this should be improved on a per-call basis later.
Diffstat (limited to 'src/rpc/server.h')
-rw-r--r-- | src/rpc/server.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rpc/server.h b/src/rpc/server.h index f3cdf3c602..fed3d8c90f 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -136,6 +136,7 @@ public: std::string name; rpcfn_type actor; bool okSafeMode; + std::vector<std::string> argNames; }; /** |