fixed type mismatch checking to not fail fast and work through nested data

This commit is contained in:
2025-09-12 22:59:27 -04:00
parent 3fdbf60396
commit 3d770b0831
3 changed files with 369 additions and 317 deletions

View File

@ -591,9 +591,10 @@ pub fn punc_with_refs_schemas() -> JsonB {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" }
"name": { "type": "string" },
"type": { "type": "string" }
},
"required": ["id"]
"required": ["id", "type"]
}]
},
{
@ -680,9 +681,10 @@ pub fn punc_local_refs_schemas() -> JsonB {
"$id": "global_thing",
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" }
"id": { "type": "string", "format": "uuid" },
"type": { "type": "string" }
},
"required": ["id"]
"required": ["id", "type"]
}]
}
]);
@ -800,6 +802,29 @@ pub fn type_matching_schemas() -> JsonB {
]
}
]);
let puncs = json!([]);
let puncs = json!([{
"name": "type_test_punc",
"public": false,
"schemas": [{
"$id": "type_test_punc.request",
"type": "object",
"properties": {
"root_job": { "$ref": "job" },
"nested_or_super_job": {
"oneOf": [
{ "$ref": "super_job" },
{
"type": "object",
"properties": {
"my_job": { "$ref": "job" }
},
"required": ["my_job"]
}
]
}
},
"required": ["root_job", "nested_or_super_job"]
}]
}]);
cache_json_schemas(jsonb(enums), jsonb(types), jsonb(puncs))
}