use openapi_ui::{generate_docs, ThemeMode};
use std::fs;
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let sample_spec = include_str!("../src/sample_data.json");
let html = generate_docs(sample_spec, ThemeMode::System, None, None)?;
let output_path = Path::new("docs.html");
fs::write(output_path, &html)?;
println!("✓ Generated docs.html successfully!");
println!(" File size: {} bytes", html.len());
println!(" Output: {}", output_path.display());
if html.contains("uploadImage") && html.contains("findByStatus") {
println!("✓ Sample API endpoints are embedded in the HTML");
}
if html.contains("data-theme=\"system\"") {
println!("✓ System theme switching is enabled");
}
Ok(())
}