From e2f0ca9cbea82e1fdbab04518de0028d11222bdf Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 19 Jun 2022 16:48:11 +0930 Subject: [PATCH] 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 Changelog-Deprecated: `listconfigs` `plugins` `options` which are not set are omitted, not `null`. --- lightningd/plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 1497439cc..dad4854ec 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -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);