B #-: Fix CLI json/yaml output for xsd with several top-level elements (#4685)

This commit is contained in:
Jan Orel authored and GitHub committed 2026-11-04 09:23:54 +01:00
1 parent 2450d99464
commit 111169de33
1 file changed
+6
+6
View File
@@ -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