diff --git a/Cargo.lock b/Cargo.lock index d3c0865..9510874 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -458,7 +458,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "openapi-parser" -version = "0.6.0" +version = "0.6.1" dependencies = [ "clap", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index 4e254b9..df94315 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "Extract schemas definitions tree from OpenAPI documents" authors = ["Pierre Hubert "] license = "MIT" repository = "https://gitea.communiquons.org/pierre/OpenAPI-Parser" -version = "0.6.0" +version = "0.6.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index bbf5bdb..9618946 100644 --- a/src/main.rs +++ b/src/main.rs @@ -208,7 +208,10 @@ fn tex_export(tree: &TreeNode) -> String { // JSON export out.push_str(&format!("\\newsavebox{{{box_name}}}\n")); out.push_str(&format!("\\begin{{lrbox}}{{{box_name}}}\n")); - out.push_str("\\begin{jsonsample}\n"); + out.push_str(&format!( + "\\begin{{jsonsample}}{{{}}}\n", + tex_escape_str(&tree.name) + )); out.push_str("\\begin{lstlisting}[language=json]\n"); let json_doc = serde_json::to_string_pretty(&tree.example_value(1)).unwrap(); let replace_key = serde_json::to_string(REF_OBJECT).unwrap();