Compare commits

...

2 Commits

Author SHA1 Message Date
97966c983a Bump version 2023-02-10 11:02:17 +01:00
bf2aada26f Improve previous fix 2023-02-10 11:01:35 +01:00
3 changed files with 5 additions and 4 deletions

2
Cargo.lock generated
View File

@@ -221,7 +221,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
[[package]] [[package]]
name = "openapi-parser" name = "openapi-parser"
version = "0.4.5" version = "0.4.6"
dependencies = [ dependencies = [
"clap", "clap",
"env_logger", "env_logger",

View File

@@ -4,7 +4,7 @@ description = "Extract schemas definitions tree from OpenAPI documents"
authors = ["Pierre Hubert <pierre.hubert.git@communiquons.org>"] authors = ["Pierre Hubert <pierre.hubert.git@communiquons.org>"]
license = "MIT" license = "MIT"
repository = "https://gitea.communiquons.org/pierre/OpenAPI-Parser" repository = "https://gitea.communiquons.org/pierre/OpenAPI-Parser"
version = "0.4.5" version = "0.4.6"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -85,10 +85,11 @@ fn recurse_export(
out: &mut String, out: &mut String,
already_processed: &mut HashSet<String>, already_processed: &mut HashSet<String>,
) { ) {
if already_processed.contains(&node.name) { let key = format!("{} #> {}", parent_name, node.name);
if already_processed.contains(&key) {
return; return;
} }
already_processed.insert(node.name.to_string()); already_processed.insert(key);
if !parent_name.is_empty() && matches!(node.r#type, NodeType::Object { .. }) { if !parent_name.is_empty() && matches!(node.r#type, NodeType::Object { .. }) {
writeln!(out, "\"{}\" -> \"{}\";", parent_name, node.name).unwrap(); writeln!(out, "\"{}\" -> \"{}\";", parent_name, node.name).unwrap();