Generate and normalize a JSON schema from the binary. Ensures a consistent trailing newline so files are stable across editors.
(sh: &Shell, of: &str)
| 609 | /// Generate and normalize a JSON schema from the binary. |
| 610 | /// Ensures a consistent trailing newline so files are stable across editors. |
| 611 | fn generate_normalized_json_schema(sh: &Shell, of: &str) -> Result<String> { |
| 612 | let schema = cmd!(sh, "cargo run -q -- internals print-json-schema --of={of}").read()?; |
| 613 | Ok(if schema.ends_with('\n') { |
| 614 | schema |
| 615 | } else { |
| 616 | format!("{schema}\n") |
| 617 | }) |
| 618 | } |
| 619 | |
| 620 | /// Update JSON schema files |
| 621 | #[context("Updating JSON schemas")] |
no test coverage detected