diff --git a/sample_parser/src/json_schema_testsuite.rs b/sample_parser/src/json_schema_testsuite.rs index 47f0927..070cfd6 100644 --- a/sample_parser/src/json_schema_testsuite.rs +++ b/sample_parser/src/json_schema_testsuite.rs @@ -222,8 +222,11 @@ fn main() { for arg in &args[1..] { let schema_file = read_file_to_string(arg); - let val: Vec = - serde_json::from_str(&schema_file).expect("Invalid JSON in schema"); + let val: Vec = if schema_file.starts_with("{") { + vec![serde_json::from_str(&schema_file).expect("Invalid JSON in single schema")] + } else { + serde_json::from_str(&schema_file).expect("Invalid JSON in array schema") + }; for (idx, t) in val.iter().enumerate() { stats.num_tests += 1; print!("Running test: {} ({}) #{} ", arg, t.description, idx);