use blazingly_json::Value;
#[test]
fn checked_in_schema_describes_new_envelope_all_operations_and_strict_evidence() {
let schema: Value = blazingly_json::from_str(include_str!(
"../docs/schema/weavatrix.refactor-plan.profile.v1.schema.json"
))
.unwrap();
assert_eq!(
schema["$schema"].as_str(),
Some("https://json-schema.org/draft/2020-12/schema")
);
assert_eq!(
schema["properties"]["schemaVersion"]["const"].as_str(),
Some("weavatrix.refactor-plan.v1")
);
let required = schema["required"].as_array().unwrap();
for field in [
"operations",
"completenessProof",
"graphRevision",
"uncertainReferences",
"notModified",
] {
assert!(required.iter().any(|value| value.as_str() == Some(field)));
}
for definition in [
"modifyOperation",
"createOperation",
"deleteOperation",
"renameOperation",
"evidenceScope",
"plannerIdentity",
] {
assert!(schema["$defs"][definition].is_object(), "{definition}");
}
assert_eq!(schema["allOf"].as_array().unwrap().len(), 2);
}