feat: Initial rewrite of python render tool

This commit is contained in:
2026-03-16 03:14:33 +01:00
commit e4d39de2f0
24 changed files with 4453 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
use std::fs::File;
use std::io::Write;
use crete::cluster::OptionalCluster;
use crete::node::OptionalNode;
use repo_path::repo_path;
use schemars::{JsonSchema, schema_for};
fn write<T>(name: &str)
where
T: JsonSchema,
{
let mut path = repo_path!("schemas").join(name);
path.add_extension("json");
let mut file = File::create(path).unwrap();
let schema = serde_json::to_string_pretty(&schema_for!(T)).unwrap();
file.write_all(schema.as_bytes()).unwrap();
}
fn main() {
write::<OptionalCluster>("cluster");
write::<OptionalNode>("node");
}