///|
pub struct RefSchema {
pointer : JsonPointer
} derive(Debug, Eq, FromJson, ToJson)
///|
impl Validatable for RefSchema with fn validate(
self,
value,
resolver~,
json_path~,
schema_path~,
) {
// ignore((json_path, schema_path))
// ...
match resolver.resolve(self.pointer) {
Some(resolved_schema) => {
// let opath = ObjectPath::from_json_pointer(ref_expr)
let errors = resolved_schema.validate(
value,
json_path~,
// TODO: fix schema_path to reference path
schema_path=schema_path.key("$ref"),
resolver~,
)
errors
}
None =>
[
ValidationError::new(
value,
json_path,
schema_path.key("$ref"),
"Failed to resolve reference '\{self.pointer}'",
),
]
}
}