From 111169de33a329abe4f1b0efadc1e04d3498f995 Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Wed, 4 Nov 2026 09:23:54 +0100 Subject: [PATCH] B #-: Fix CLI json/yaml output for xsd with several top-level elements (#4685) --- src/cli/one_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index cfd817a852..3d97cd2094 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -1435,6 +1435,12 @@ Bash symbols must be escaped on STDIN passing' hash = hash['schema']['element'] + # Schemas may define several top-level elements (e.g. vnet.xsd + # defines MIRROR and VNET), pick the one matching the resource + if hash.is_a?(Array) + hash = hash.find {|e| e['name'] == ename } || hash.first + end + replace_refs(hash) end