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

@ -75,13 +75,30 @@
{
"description": "happy path passes structural validation",
"data": {
"primitives": ["a", "b"],
"ad_hoc_objects": [{"name": "obj1"}],
"entities": [{"id": "entity-1", "value": 15}],
"primitives": [
"a",
"b"
],
"ad_hoc_objects": [
{
"name": "obj1"
}
],
"entities": [
{
"id": "entity-1",
"value": 15
}
],
"deep_entities": [
{
"id": "parent-1",
"nested": [{"id": "child-1", "flag": true}]
"nested": [
{
"id": "child-1",
"flag": true
}
]
}
]
},
@ -94,7 +111,10 @@
{
"description": "primitive arrays use numeric indexing",
"data": {
"primitives": ["a", 123]
"primitives": [
"a",
123
]
},
"schema_id": "hybrid_pathing",
"action": "validate",
@ -103,7 +123,7 @@
"errors": [
{
"code": "INVALID_TYPE",
"path": "/primitives/1"
"path": "primitives/1"
}
]
}
@ -112,8 +132,12 @@
"description": "ad-hoc objects without ids use numeric indexing",
"data": {
"ad_hoc_objects": [
{"name": "valid"},
{"age": 30}
{
"name": "valid"
},
{
"age": 30
}
]
},
"schema_id": "hybrid_pathing",
@ -123,7 +147,7 @@
"errors": [
{
"code": "REQUIRED_FIELD_MISSING",
"path": "/ad_hoc_objects/1/name"
"path": "ad_hoc_objects/1/name"
}
]
}
@ -132,8 +156,14 @@
"description": "arrays of objects with ids use topological uuid indexing",
"data": {
"entities": [
{"id": "entity-alpha", "value": 20},
{"id": "entity-beta", "value": 5}
{
"id": "entity-alpha",
"value": 20
},
{
"id": "entity-beta",
"value": 5
}
]
},
"schema_id": "hybrid_pathing",
@ -143,7 +173,7 @@
"errors": [
{
"code": "MINIMUM_VIOLATED",
"path": "/entities/entity-beta/value"
"path": "entities/entity-beta/value"
}
]
}
@ -155,8 +185,14 @@
{
"id": "parent-omega",
"nested": [
{"id": "child-alpha", "flag": true},
{"id": "child-beta", "flag": "invalid-string"}
{
"id": "child-alpha",
"flag": true
},
{
"id": "child-beta",
"flag": "invalid-string"
}
]
}
]
@ -168,11 +204,11 @@
"errors": [
{
"code": "INVALID_TYPE",
"path": "/deep_entities/parent-omega/nested/child-beta/flag"
"path": "deep_entities/parent-omega/nested/child-beta/flag"
}
]
}
}
]
}
]
]