pub fn validate(spec_json: &str) -> Result<JsValue, JsValue>
Validate a spec JSON blob and return a structured result.