Migrate repository routes to ServerApi
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
use std::{env, fs, path::PathBuf};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let output = env::args_os()
|
||||
.nth(1)
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|| PathBuf::from("openapi/server-api.json"));
|
||||
let document = server_api::canonical_openapi_document()?;
|
||||
let json = document.to_json()?;
|
||||
if let Some(parent) = output.parent() {
|
||||
fs::create_dir_all(parent)?;
|
||||
}
|
||||
fs::write(&output, json)?;
|
||||
println!("wrote {}", output.display());
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user