misc: configurator: Bugfix: misplaced enum property
During conversion from xml to scenario.json, elements with "maxOccurs" property is processed as json array, and (most) properties of that elements goes to the json array. However the "enum" property should belong to the array item, not the array itself. Tracked-On: #7421 Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
parent
bf656a1141
commit
33c506427e
|
@ -331,7 +331,11 @@ class XS2JS:
|
|||
'selector': element['xs:annotation']['@acrn:options'],
|
||||
'sorted': element['xs:annotation'].get('@acrn:options-sorted-by', None)
|
||||
}
|
||||
js_ele['enum'] = dynamic_enum
|
||||
# enum should be applied to array items instead of array itself
|
||||
if 'items' in js_ele:
|
||||
js_ele['items']['enum'] = dynamic_enum
|
||||
else:
|
||||
js_ele['enum'] = dynamic_enum
|
||||
|
||||
properties[name] = js_ele
|
||||
|
||||
|
|
Loading…
Reference in New Issue