removed initial / in validator making paths consistent across validate merger and queryer

This commit is contained in:
2026-03-26 22:27:59 -04:00
parent eb91b65e65
commit c4e8e0309f
9 changed files with 83 additions and 39 deletions

View File

@ -92,10 +92,10 @@ impl<'a> ValidationContext<'a> {
for (i, sub_schema) in prefix.iter().enumerate() {
if i < len {
if let Some(child_instance) = arr.get(i) {
let mut item_path = format!("{}/{}", self.path, i);
let mut item_path = self.join_path(&i.to_string());
if let Some(obj) = child_instance.as_object() {
if let Some(id_str) = obj.get("id").and_then(|v| v.as_str()) {
item_path = format!("{}/{}", self.path, id_str);
item_path = self.join_path(id_str);
}
}
let derived = self.derive(
@ -118,10 +118,10 @@ impl<'a> ValidationContext<'a> {
if let Some(ref items_schema) = self.schema.items {
for i in validation_index..len {
if let Some(child_instance) = arr.get(i) {
let mut item_path = format!("{}/{}", self.path, i);
let mut item_path = self.join_path(&i.to_string());
if let Some(obj) = child_instance.as_object() {
if let Some(id_str) = obj.get("id").and_then(|v| v.as_str()) {
item_path = format!("{}/{}", self.path, id_str);
item_path = self.join_path(id_str);
}
}
let derived = self.derive(