lightningd: don't add null for unset plugin options.

In general, we don't like to use `null` in JSON: simply omit the
field.  I found this one because it broke our 'msat' parsing (made
stricter in followup) which doesn't allow `null`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: `listconfigs` `plugins` `options` which are not set are omitted, not `null`.
This commit is contained in:
Rusty Russell
2022-06-19 16:48:11 +09:30
parent a52bdeee01
commit e2f0ca9cbe

View File

@@ -1952,7 +1952,8 @@ void json_add_opt_plugins_array(struct json_stream *response,
opt->type,
opt->values[0]);
} else {
json_add_null(response, opt_name);
if (deprecated_apis)
json_add_null(response, opt_name);
}
}
json_object_end(response);