jsonrpc: make "jsonrpc" actually optional

The decoder was still marked as required, so omitting "jsonrpc" version
from the request did not work.

Change-Id: Ied6a8bb1fbbf072c5eff87ed0b343edd7b3702b3
Fixes: aa67900a2e42 ("jsonrpc: make "jsonrpc" request field optional")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412859
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-05-29 11:12:56 -07:00 committed by Jim Harris
parent 1e481d0438
commit da7673f71f

View File

@ -52,7 +52,7 @@ capture_val(const struct spdk_json_val *val, void *out)
}
static const struct spdk_json_object_decoder jsonrpc_request_decoders[] = {
{"jsonrpc", offsetof(struct jsonrpc_request, version), capture_val},
{"jsonrpc", offsetof(struct jsonrpc_request, version), capture_val, true},
{"method", offsetof(struct jsonrpc_request, method), capture_val},
{"params", offsetof(struct jsonrpc_request, params), capture_val, true},
{"id", offsetof(struct jsonrpc_request, id), capture_val, true},