From 0ad4e147e2c92cc655b09a554893746c9ea285ba Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 19 Jun 2019 15:35:53 -0700 Subject: [PATCH] Dedup types in children property of node-types --- cli/src/generate/node_types.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cli/src/generate/node_types.rs b/cli/src/generate/node_types.rs index 51f902f5..92b9dd67 100644 --- a/cli/src/generate/node_types.rs +++ b/cli/src/generate/node_types.rs @@ -523,14 +523,17 @@ pub(crate) fn generate_node_types_json( } node_type_json.fields = Some(fields_json); if info.child_types_without_fields.len() > 0 { + let mut children_types = info + .child_types_without_fields + .iter() + .map(child_type_to_node_type) + .collect::>(); + children_types.sort_unstable(); + children_types.dedup(); node_type_json.children = Some(FieldInfoJSON { multiple: true, required: false, - types: info - .child_types_without_fields - .iter() - .map(child_type_to_node_type) - .collect(), + types: children_types, }); } }