Try not to loose existing children
This commit is contained in:
parent
5c72642634
commit
c346ce4a5e
1 changed files with 10 additions and 2 deletions
|
|
@ -615,12 +615,20 @@ pub(crate) fn generate_node_types_json(
|
|||
.iter()
|
||||
.map(child_type_to_node_type)
|
||||
.collect::<Vec<_>>();
|
||||
let mut multiple = info.children_without_fields.quantity.multiple;
|
||||
let mut required = info.children_without_fields.quantity.required;
|
||||
if let Some(children) = &mut node_type_json.children {
|
||||
println!("children: {:?}", children);
|
||||
children_types.append(&mut children.types);
|
||||
multiple |= children.multiple;
|
||||
required |= children.required;
|
||||
}
|
||||
if children_types.len() > 0 {
|
||||
children_types.sort_unstable();
|
||||
children_types.dedup();
|
||||
node_type_json.children = Some(FieldInfoJSON {
|
||||
multiple: info.children_without_fields.quantity.multiple,
|
||||
required: info.children_without_fields.quantity.required,
|
||||
multiple: multiple,
|
||||
required: required,
|
||||
types: children_types,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue