pub fn to_json(spec: &Value) -> Result<String, Error>
Serialize the spec to JSON with deterministic key ordering.