validator refactor progress

This commit is contained in:
2026-03-03 00:13:37 -05:00
parent e14f53e7d9
commit 3898c43742
81 changed files with 6331 additions and 7934 deletions

View File

@ -1,4 +1,4 @@
use jspg::*;
use ::jspg::*;
use pgrx::JsonB;
use serde_json::json;
@ -22,20 +22,22 @@ fn test_library_api() {
);
// 2. Cache schemas
let puncs = json!([]);
let types = json!([{
"schemas": [{
"$id": "test_schema",
"type": "object",
"properties": {
"name": { "type": "string" }
},
"required": ["name"]
let db_json = json!({
"puncs": [],
"enums": [],
"types": [{
"schemas": [{
"$id": "test_schema",
"type": "object",
"properties": {
"name": { "type": "string" }
},
"required": ["name"]
}]
}]
}]);
let enums = json!([]);
});
let cache_drop = cache_json_schemas(JsonB(enums), JsonB(types), JsonB(puncs));
let cache_drop = jspg_cache_database(JsonB(db_json));
assert_eq!(
cache_drop.0,
json!({