diff --git a/src/main.rs b/src/main.rs index 0cd3ce7..170c036 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,10 +85,11 @@ fn recurse_export( out: &mut String, already_processed: &mut HashSet, ) { - if already_processed.contains(&node.name) { + let key = format!("{} #> {}", parent_name, node.name); + if already_processed.contains(&key) { return; } - already_processed.insert(node.name.to_string()); + already_processed.insert(key); if !parent_name.is_empty() && matches!(node.r#type, NodeType::Object { .. }) { writeln!(out, "\"{}\" -> \"{}\";", parent_name, node.name).unwrap();