Add object name in jsonsample environment
This commit is contained in:
parent
536125a4f4
commit
d6d0b10537
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -458,7 +458,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openapi-parser"
|
name = "openapi-parser"
|
||||||
version = "0.6.0"
|
version = "0.6.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
@ -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.6.0"
|
version = "0.6.1"
|
||||||
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
|
||||||
|
@ -208,7 +208,10 @@ fn tex_export(tree: &TreeNode) -> String {
|
|||||||
// JSON export
|
// JSON export
|
||||||
out.push_str(&format!("\\newsavebox{{{box_name}}}\n"));
|
out.push_str(&format!("\\newsavebox{{{box_name}}}\n"));
|
||||||
out.push_str(&format!("\\begin{{lrbox}}{{{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");
|
out.push_str("\\begin{lstlisting}[language=json]\n");
|
||||||
let json_doc = serde_json::to_string_pretty(&tree.example_value(1)).unwrap();
|
let json_doc = serde_json::to_string_pretty(&tree.example_value(1)).unwrap();
|
||||||
let replace_key = serde_json::to_string(REF_OBJECT).unwrap();
|
let replace_key = serde_json::to_string(REF_OBJECT).unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user