fixed missing schema ids in validation results

This commit is contained in:
2026-06-18 20:31:35 -04:00
parent 9e362f2168
commit 01368305de
2 changed files with 11 additions and 5 deletions

View File

@ -251,12 +251,18 @@ fn test_library_api() {
{
"code": "REQUIRED_FIELD_MISSING",
"message": "Missing name",
"details": { "path": "name" }
"details": {
"path": "name",
"schema": "source_schema"
}
},
{
"code": "STRICT_PROPERTY_VIOLATION",
"message": "Unexpected property 'wrong'",
"details": { "path": "wrong" }
"details": {
"path": "wrong",
"schema": "source_schema"
}
}
]
})

View File

@ -69,7 +69,7 @@ impl Validator {
path: Some(e.path),
cause: None,
context: None,
schema: None,
schema: Some(schema_id.to_string()),
},
})
.collect();
@ -83,7 +83,7 @@ impl Validator {
path: Some(e.path),
cause: None,
context: None,
schema: None,
schema: Some(schema_id.to_string()),
},
}]),
}
@ -95,7 +95,7 @@ impl Validator {
path: Some("/".to_string()),
cause: None,
context: None,
schema: None,
schema: Some(schema_id.to_string()),
},
}])
}