From 8eac60f023db1b6207e15dba0cd146a94937fa59 Mon Sep 17 00:00:00 2001 From: SKP Date: Mon, 19 Aug 2019 18:30:41 +0200 Subject: [PATCH] Required feature properties will only fail the validation if features is enabled and they are missing. If the feature is not enabled, validation does not fail --- .../schema/config-v0.2.2.json | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/cyphernodeconf_docker/schema/config-v0.2.2.json b/cyphernodeconf_docker/schema/config-v0.2.2.json index f28940f..9af3d14 100644 --- a/cyphernodeconf_docker/schema/config-v0.2.2.json +++ b/cyphernodeconf_docker/schema/config-v0.2.2.json @@ -30,14 +30,7 @@ "gatekeeper_clientkeyspassword", "gatekeeper_datapath", "gatekeeper_port", - "lightning_announce", - "lightning_expose", - "lightning_implementation", - "lightning_datapath", - "lightning_nodename", - "lightning_nodecolor", "proxy_datapath", - "otsclient_datapath", "traefik_datapath", "traefik_http_port", "traefik_https_port" @@ -91,6 +84,47 @@ "bitcoin_prune_size" ] } + }, + { + "if": { + "properties": { + "features": { + "contains": { + "enum": [ + "lightning" + ] + } + } + } + }, + "then": { + "required": [ + "lightning_announce", + "lightning_expose", + "lightning_implementation", + "lightning_datapath", + "lightning_nodename", + "lightning_nodecolor" + ] + } + }, + { + "if": { + "properties": { + "features": { + "contains": { + "enum": [ + "otsclient" + ] + } + } + } + }, + "then": { + "required": [ + "otsclient_datapath" + ] + } } ], "properties": { @@ -552,4 +586,4 @@ ] } } -} \ No newline at end of file +}