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.
@@ -331,6 +331,10 @@ class XS2JS:
'selector': element['xs:annotation']['@acrn:options'],
'sorted': element['xs:annotation'].get('@acrn:options-sorted-by', None)
}
+ # 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
