From 274dcec1a59f88c23b4b4c510c1b34b419491f14 Mon Sep 17 00:00:00 2001 From: Anuj Hydrabadi Date: Mon, 27 Oct 2025 11:48:34 +0530 Subject: [PATCH] Support array of objects in x-ui-visible-if schema --- ftf_cli/schema.py | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/ftf_cli/schema.py b/ftf_cli/schema.py index c18ae9c..5d5dfef 100644 --- a/ftf_cli/schema.py +++ b/ftf_cli/schema.py @@ -130,15 +130,34 @@ "x-ui-yaml-editor": {"type": "boolean"}, "x-ui-error-message": {"type": "string"}, "x-ui-visible-if": { - "type": "object", - "properties": { - "field": {"type": "string", "pattern": r"^spec\..+"}, - "values": { + "oneOf": [ + { + "type": "object", + "properties": { + "field": {"type": "string", "pattern": r"^spec\..+"}, + "values": { + "type": "array", + "minItems": 1, + }, + }, + "required": ["field", "values"], + }, + { "type": "array", + "items": { + "type": "object", + "properties": { + "field": {"type": "string", "pattern": r"^spec\..+"}, + "values": { + "type": "array", + "minItems": 1, + }, + }, + "required": ["field", "values"], + }, "minItems": 1, - }, - }, - "required": ["field", "values"], + } + ] }, }, "additionalProperties": {