diff --git a/src/main.rs b/src/main.rs index ea49721..c82abd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,13 @@ pub fn get_frontmatter(markdown: &str) -> Option { fn require_everything(schema: &mut serde_json::Value) { if let Some(schema_obj) = schema.as_object_mut() { - if schema_obj.get("type").unwrap().as_str().unwrap() == "object" { + if match schema_obj.get("type").unwrap() { + serde_json::Value::String(str) => str == "object", + serde_json::Value::Array(lst) => { + lst.contains(&serde_json::Value::String("object".into())) + } + _ => false, + } { let keys: Vec<_> = schema_obj .get("properties") .unwrap() @@ -99,7 +105,11 @@ fn main() { //println!("{file}: {:#?}", error); - let file = Style::new().blue().apply_to(file); + let file = Style::new().blue().apply_to(if file.contains(' ') { + format!("\"{file}\"") + } else { + file.to_string() + }); let path = Style::new().bright().red().apply_to(path); match error.kind {