jspg progress

This commit is contained in:
2026-02-17 21:46:10 -05:00
parent 32ed463df8
commit 623c34c0bc
20 changed files with 3566 additions and 1094 deletions

View File

@ -19,21 +19,21 @@ fn main() {
writeln!(std_file, "use jspg::util;").unwrap();
// Helper for snake_case conversion
let to_snake_case = |s: &str| -> String {
s.chars().fold(String::new(), |mut acc, c| {
if c.is_uppercase() {
if !acc.is_empty() {
acc.push('_');
}
acc.push(c.to_ascii_lowercase());
} else if c == '-' || c == ' ' || c == '.' || c == '/' || c == ':' {
acc.push('_');
} else if c.is_alphanumeric() {
acc.push(c);
}
acc
})
};
// let _to_snake_case = |s: &str| -> String {
// s.chars().fold(String::new(), |mut acc, c| {
// if c.is_uppercase() {
// if !acc.is_empty() {
// acc.push('_');
// }
// acc.push(c.to_ascii_lowercase());
// } else if c == '-' || c == ' ' || c == '.' || c == '/' || c == ':' {
// acc.push('_');
// } else if c.is_alphanumeric() {
// acc.push(c);
// }
// acc
// })
// };
// Walk tests/fixtures directly
let fixtures_path = "tests/fixtures";
@ -50,11 +50,29 @@ fn main() {
if let Some(arr) = val.as_array() {
for (i, _item) in arr.iter().enumerate() {
// Use short, deterministic names to avoid Postgres 63-byte limit
// e.g. test_dynamic_ref_case_0
let fn_name = format!("test_{}_case_{}", to_snake_case(file_name), i);
// Use deterministic names: test_{filename}_{index}
// We sanitize the filename to be a valid identifier
// Use manual snake_case logic since we don't want to add a build-dependency just yet if not needed,
// but `dynamicRef` -> `dynamic_ref` requires parsing.
// Let's implement a simple camelToSnake helper.
let mut safe_filename = String::new();
for (i, c) in file_name.chars().enumerate() {
if c.is_uppercase() {
if i > 0 {
safe_filename.push('_');
}
safe_filename.push(c.to_ascii_lowercase());
} else if c == '-' || c == '.' {
safe_filename.push('_');
} else {
safe_filename.push(c);
}
}
let fn_name = format!("test_{}_{}", safe_filename, i);
// Write to src/tests.rs (PG Test)
// CARGO_MANIFEST_DIR is used to find the absolute path to fixtures at runtime
write!(
pg_file,
r#"

813
debug.log Normal file
View File

@ -0,0 +1,813 @@
warning: function `test_uniqueItems_0` should have a snake case name
--> tests/tests.rs:52:4
|
52 | fn test_uniqueItems_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_0`
|
= note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default
warning: function `test_uniqueItems_1` should have a snake case name
--> tests/tests.rs:58:4
|
58 | fn test_uniqueItems_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_1`
warning: function `test_uniqueItems_2` should have a snake case name
--> tests/tests.rs:64:4
|
64 | fn test_uniqueItems_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_2`
warning: function `test_uniqueItems_3` should have a snake case name
--> tests/tests.rs:70:4
|
70 | fn test_uniqueItems_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_3`
warning: function `test_uniqueItems_4` should have a snake case name
--> tests/tests.rs:76:4
|
76 | fn test_uniqueItems_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_4`
warning: function `test_uniqueItems_5` should have a snake case name
--> tests/tests.rs:82:4
|
82 | fn test_uniqueItems_5() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_5`
warning: function `test_uniqueItems_6` should have a snake case name
--> tests/tests.rs:88:4
|
88 | fn test_uniqueItems_6() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_6`
warning: function `test_minItems_0` should have a snake case name
--> tests/tests.rs:94:4
|
94 | fn test_minItems_0() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_0`
warning: function `test_minItems_1` should have a snake case name
--> tests/tests.rs:100:4
|
100 | fn test_minItems_1() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_1`
warning: function `test_minItems_2` should have a snake case name
--> tests/tests.rs:106:4
|
106 | fn test_minItems_2() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_2`
warning: function `test_exclusiveMinimum_0` should have a snake case name
--> tests/tests.rs:160:4
|
160 | fn test_exclusiveMinimum_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_exclusive_minimum_0`
warning: function `test_anyOf_0` should have a snake case name
--> tests/tests.rs:274:4
|
274 | fn test_anyOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_0`
warning: function `test_anyOf_1` should have a snake case name
--> tests/tests.rs:280:4
|
280 | fn test_anyOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_1`
warning: function `test_anyOf_2` should have a snake case name
--> tests/tests.rs:286:4
|
286 | fn test_anyOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_2`
warning: function `test_anyOf_3` should have a snake case name
--> tests/tests.rs:292:4
|
292 | fn test_anyOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_3`
warning: function `test_anyOf_4` should have a snake case name
--> tests/tests.rs:298:4
|
298 | fn test_anyOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_4`
warning: function `test_anyOf_5` should have a snake case name
--> tests/tests.rs:304:4
|
304 | fn test_anyOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_5`
warning: function `test_anyOf_6` should have a snake case name
--> tests/tests.rs:310:4
|
310 | fn test_anyOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_6`
warning: function `test_anyOf_7` should have a snake case name
--> tests/tests.rs:316:4
|
316 | fn test_anyOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_7`
warning: function `test_anyOf_8` should have a snake case name
--> tests/tests.rs:322:4
|
322 | fn test_anyOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_8`
warning: function `test_anyOf_9` should have a snake case name
--> tests/tests.rs:328:4
|
328 | fn test_anyOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_9`
warning: function `test_propertyNames_0` should have a snake case name
--> tests/tests.rs:334:4
|
334 | fn test_propertyNames_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_0`
warning: function `test_propertyNames_1` should have a snake case name
--> tests/tests.rs:340:4
|
340 | fn test_propertyNames_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_1`
warning: function `test_propertyNames_2` should have a snake case name
--> tests/tests.rs:346:4
|
346 | fn test_propertyNames_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_2`
warning: function `test_propertyNames_3` should have a snake case name
--> tests/tests.rs:352:4
|
352 | fn test_propertyNames_3() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_3`
warning: function `test_propertyNames_4` should have a snake case name
--> tests/tests.rs:358:4
|
358 | fn test_propertyNames_4() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_4`
warning: function `test_propertyNames_5` should have a snake case name
--> tests/tests.rs:364:4
|
364 | fn test_propertyNames_5() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_5`
warning: function `test_propertyNames_6` should have a snake case name
--> tests/tests.rs:370:4
|
370 | fn test_propertyNames_6() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_6`
warning: function `test_minProperties_0` should have a snake case name
--> tests/tests.rs:646:4
|
646 | fn test_minProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_0`
warning: function `test_minProperties_1` should have a snake case name
--> tests/tests.rs:652:4
|
652 | fn test_minProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_1`
warning: function `test_minProperties_2` should have a snake case name
--> tests/tests.rs:658:4
|
658 | fn test_minProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_2`
warning: function `test_minContains_0` should have a snake case name
--> tests/tests.rs:664:4
|
664 | fn test_minContains_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_0`
warning: function `test_minContains_1` should have a snake case name
--> tests/tests.rs:670:4
|
670 | fn test_minContains_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_1`
warning: function `test_minContains_2` should have a snake case name
--> tests/tests.rs:676:4
|
676 | fn test_minContains_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_2`
warning: function `test_minContains_3` should have a snake case name
--> tests/tests.rs:682:4
|
682 | fn test_minContains_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_3`
warning: function `test_minContains_4` should have a snake case name
--> tests/tests.rs:688:4
|
688 | fn test_minContains_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_4`
warning: function `test_minContains_5` should have a snake case name
--> tests/tests.rs:694:4
|
694 | fn test_minContains_5() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_5`
warning: function `test_minContains_6` should have a snake case name
--> tests/tests.rs:700:4
|
700 | fn test_minContains_6() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_6`
warning: function `test_minContains_7` should have a snake case name
--> tests/tests.rs:706:4
|
706 | fn test_minContains_7() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_7`
warning: function `test_minContains_8` should have a snake case name
--> tests/tests.rs:712:4
|
712 | fn test_minContains_8() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_8`
warning: function `test_maxContains_0` should have a snake case name
--> tests/tests.rs:796:4
|
796 | fn test_maxContains_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_0`
warning: function `test_maxContains_1` should have a snake case name
--> tests/tests.rs:802:4
|
802 | fn test_maxContains_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_1`
warning: function `test_maxContains_2` should have a snake case name
--> tests/tests.rs:808:4
|
808 | fn test_maxContains_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_2`
warning: function `test_maxContains_3` should have a snake case name
--> tests/tests.rs:814:4
|
814 | fn test_maxContains_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_3`
warning: function `test_maxContains_4` should have a snake case name
--> tests/tests.rs:820:4
|
820 | fn test_maxContains_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_4`
warning: function `test_maxLength_0` should have a snake case name
--> tests/tests.rs:826:4
|
826 | fn test_maxLength_0() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_length_0`
warning: function `test_maxLength_1` should have a snake case name
--> tests/tests.rs:832:4
|
832 | fn test_maxLength_1() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_length_1`
warning: function `test_dependentSchemas_0` should have a snake case name
--> tests/tests.rs:838:4
|
838 | fn test_dependentSchemas_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_0`
warning: function `test_dependentSchemas_1` should have a snake case name
--> tests/tests.rs:844:4
|
844 | fn test_dependentSchemas_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_1`
warning: function `test_dependentSchemas_2` should have a snake case name
--> tests/tests.rs:850:4
|
850 | fn test_dependentSchemas_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_2`
warning: function `test_dependentSchemas_3` should have a snake case name
--> tests/tests.rs:856:4
|
856 | fn test_dependentSchemas_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_3`
warning: function `test_exclusiveMaximum_0` should have a snake case name
--> tests/tests.rs:862:4
|
862 | fn test_exclusiveMaximum_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_exclusive_maximum_0`
warning: function `test_prefixItems_0` should have a snake case name
--> tests/tests.rs:868:4
|
868 | fn test_prefixItems_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_0`
warning: function `test_prefixItems_1` should have a snake case name
--> tests/tests.rs:874:4
|
874 | fn test_prefixItems_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_1`
warning: function `test_prefixItems_2` should have a snake case name
--> tests/tests.rs:880:4
|
880 | fn test_prefixItems_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_2`
warning: function `test_prefixItems_3` should have a snake case name
--> tests/tests.rs:886:4
|
886 | fn test_prefixItems_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_3`
warning: function `test_prefixItems_4` should have a snake case name
--> tests/tests.rs:892:4
|
892 | fn test_prefixItems_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_4`
warning: function `test_oneOf_0` should have a snake case name
--> tests/tests.rs:910:4
|
910 | fn test_oneOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_0`
warning: function `test_oneOf_1` should have a snake case name
--> tests/tests.rs:916:4
|
916 | fn test_oneOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_1`
warning: function `test_oneOf_2` should have a snake case name
--> tests/tests.rs:922:4
|
922 | fn test_oneOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_2`
warning: function `test_oneOf_3` should have a snake case name
--> tests/tests.rs:928:4
|
928 | fn test_oneOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_3`
warning: function `test_oneOf_4` should have a snake case name
--> tests/tests.rs:934:4
|
934 | fn test_oneOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_4`
warning: function `test_oneOf_5` should have a snake case name
--> tests/tests.rs:940:4
|
940 | fn test_oneOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_5`
warning: function `test_oneOf_6` should have a snake case name
--> tests/tests.rs:946:4
|
946 | fn test_oneOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_6`
warning: function `test_oneOf_7` should have a snake case name
--> tests/tests.rs:952:4
|
952 | fn test_oneOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_7`
warning: function `test_oneOf_8` should have a snake case name
--> tests/tests.rs:958:4
|
958 | fn test_oneOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_8`
warning: function `test_oneOf_9` should have a snake case name
--> tests/tests.rs:964:4
|
964 | fn test_oneOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_9`
warning: function `test_oneOf_10` should have a snake case name
--> tests/tests.rs:970:4
|
970 | fn test_oneOf_10() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_10`
warning: function `test_oneOf_11` should have a snake case name
--> tests/tests.rs:976:4
|
976 | fn test_oneOf_11() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_11`
warning: function `test_oneOf_12` should have a snake case name
--> tests/tests.rs:982:4
|
982 | fn test_oneOf_12() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_12`
warning: function `test_emptyString_0` should have a snake case name
--> tests/tests.rs:1072:4
|
1072 | fn test_emptyString_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_empty_string_0`
warning: function `test_maxProperties_0` should have a snake case name
--> tests/tests.rs:1090:4
|
1090 | fn test_maxProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_0`
warning: function `test_maxProperties_1` should have a snake case name
--> tests/tests.rs:1096:4
|
1096 | fn test_maxProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_1`
warning: function `test_maxProperties_2` should have a snake case name
--> tests/tests.rs:1102:4
|
1102 | fn test_maxProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_2`
warning: function `test_maxProperties_3` should have a snake case name
--> tests/tests.rs:1108:4
|
1108 | fn test_maxProperties_3() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_3`
warning: function `test_dependentRequired_0` should have a snake case name
--> tests/tests.rs:1114:4
|
1114 | fn test_dependentRequired_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_0`
warning: function `test_dependentRequired_1` should have a snake case name
--> tests/tests.rs:1120:4
|
1120 | fn test_dependentRequired_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_1`
warning: function `test_dependentRequired_2` should have a snake case name
--> tests/tests.rs:1126:4
|
1126 | fn test_dependentRequired_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_2`
warning: function `test_dependentRequired_3` should have a snake case name
--> tests/tests.rs:1132:4
|
1132 | fn test_dependentRequired_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_3`
warning: function `test_dependentRequired_4` should have a snake case name
--> tests/tests.rs:1138:4
|
1138 | fn test_dependentRequired_4() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_4`
warning: function `test_multipleOf_0` should have a snake case name
--> tests/tests.rs:1252:4
|
1252 | fn test_multipleOf_0() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_0`
warning: function `test_multipleOf_1` should have a snake case name
--> tests/tests.rs:1258:4
|
1258 | fn test_multipleOf_1() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_1`
warning: function `test_multipleOf_2` should have a snake case name
--> tests/tests.rs:1264:4
|
1264 | fn test_multipleOf_2() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_2`
warning: function `test_multipleOf_3` should have a snake case name
--> tests/tests.rs:1270:4
|
1270 | fn test_multipleOf_3() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_3`
warning: function `test_patternProperties_0` should have a snake case name
--> tests/tests.rs:1276:4
|
1276 | fn test_patternProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_0`
warning: function `test_patternProperties_1` should have a snake case name
--> tests/tests.rs:1282:4
|
1282 | fn test_patternProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_1`
warning: function `test_patternProperties_2` should have a snake case name
--> tests/tests.rs:1288:4
|
1288 | fn test_patternProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_2`
warning: function `test_patternProperties_3` should have a snake case name
--> tests/tests.rs:1294:4
|
1294 | fn test_patternProperties_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_3`
warning: function `test_patternProperties_4` should have a snake case name
--> tests/tests.rs:1300:4
|
1300 | fn test_patternProperties_4() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_4`
warning: function `test_patternProperties_5` should have a snake case name
--> tests/tests.rs:1306:4
|
1306 | fn test_patternProperties_5() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_5`
warning: function `test_allOf_0` should have a snake case name
--> tests/tests.rs:1336:4
|
1336 | fn test_allOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_0`
warning: function `test_allOf_1` should have a snake case name
--> tests/tests.rs:1342:4
|
1342 | fn test_allOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_1`
warning: function `test_allOf_2` should have a snake case name
--> tests/tests.rs:1348:4
|
1348 | fn test_allOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_2`
warning: function `test_allOf_3` should have a snake case name
--> tests/tests.rs:1354:4
|
1354 | fn test_allOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_3`
warning: function `test_allOf_4` should have a snake case name
--> tests/tests.rs:1360:4
|
1360 | fn test_allOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_4`
warning: function `test_allOf_5` should have a snake case name
--> tests/tests.rs:1366:4
|
1366 | fn test_allOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_5`
warning: function `test_allOf_6` should have a snake case name
--> tests/tests.rs:1372:4
|
1372 | fn test_allOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_6`
warning: function `test_allOf_7` should have a snake case name
--> tests/tests.rs:1378:4
|
1378 | fn test_allOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_7`
warning: function `test_allOf_8` should have a snake case name
--> tests/tests.rs:1384:4
|
1384 | fn test_allOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_8`
warning: function `test_allOf_9` should have a snake case name
--> tests/tests.rs:1390:4
|
1390 | fn test_allOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_9`
warning: function `test_allOf_10` should have a snake case name
--> tests/tests.rs:1396:4
|
1396 | fn test_allOf_10() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_10`
warning: function `test_allOf_11` should have a snake case name
--> tests/tests.rs:1402:4
|
1402 | fn test_allOf_11() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_11`
warning: function `test_allOf_12` should have a snake case name
--> tests/tests.rs:1408:4
|
1408 | fn test_allOf_12() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_12`
warning: function `test_allOf_13` should have a snake case name
--> tests/tests.rs:1414:4
|
1414 | fn test_allOf_13() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_13`
warning: function `test_allOf_14` should have a snake case name
--> tests/tests.rs:1420:4
|
1420 | fn test_allOf_14() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_14`
warning: function `test_allOf_15` should have a snake case name
--> tests/tests.rs:1426:4
|
1426 | fn test_allOf_15() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_15`
warning: function `test_minLength_0` should have a snake case name
--> tests/tests.rs:1828:4
|
1828 | fn test_minLength_0() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_length_0`
warning: function `test_minLength_1` should have a snake case name
--> tests/tests.rs:1834:4
|
1834 | fn test_minLength_1() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_length_1`
warning: function `test_maxItems_0` should have a snake case name
--> tests/tests.rs:1840:4
|
1840 | fn test_maxItems_0() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_0`
warning: function `test_maxItems_1` should have a snake case name
--> tests/tests.rs:1846:4
|
1846 | fn test_maxItems_1() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_1`
warning: function `test_maxItems_2` should have a snake case name
--> tests/tests.rs:1852:4
|
1852 | fn test_maxItems_2() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_2`
warning: function `test_dynamicRef_0` should have a snake case name
--> tests/tests.rs:1912:4
|
1912 | fn test_dynamicRef_0() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_0`
warning: function `test_dynamicRef_1` should have a snake case name
--> tests/tests.rs:1918:4
|
1918 | fn test_dynamicRef_1() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_1`
warning: function `test_dynamicRef_2` should have a snake case name
--> tests/tests.rs:1924:4
|
1924 | fn test_dynamicRef_2() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_2`
warning: function `test_dynamicRef_3` should have a snake case name
--> tests/tests.rs:1930:4
|
1930 | fn test_dynamicRef_3() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_3`
warning: function `test_dynamicRef_4` should have a snake case name
--> tests/tests.rs:1936:4
|
1936 | fn test_dynamicRef_4() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_4`
warning: function `test_dynamicRef_5` should have a snake case name
--> tests/tests.rs:1942:4
|
1942 | fn test_dynamicRef_5() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_5`
warning: function `test_dynamicRef_6` should have a snake case name
--> tests/tests.rs:1948:4
|
1948 | fn test_dynamicRef_6() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_6`
warning: function `test_dynamicRef_7` should have a snake case name
--> tests/tests.rs:1954:4
|
1954 | fn test_dynamicRef_7() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_7`
warning: function `test_dynamicRef_8` should have a snake case name
--> tests/tests.rs:1960:4
|
1960 | fn test_dynamicRef_8() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_8`
warning: function `test_dynamicRef_9` should have a snake case name
--> tests/tests.rs:1966:4
|
1966 | fn test_dynamicRef_9() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_9`
warning: function `test_dynamicRef_10` should have a snake case name
--> tests/tests.rs:1972:4
|
1972 | fn test_dynamicRef_10() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_10`
warning: function `test_dynamicRef_11` should have a snake case name
--> tests/tests.rs:1978:4
|
1978 | fn test_dynamicRef_11() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_11`
warning: function `test_dynamicRef_12` should have a snake case name
--> tests/tests.rs:1984:4
|
1984 | fn test_dynamicRef_12() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_12`
warning: function `test_dynamicRef_13` should have a snake case name
--> tests/tests.rs:1990:4
|
1990 | fn test_dynamicRef_13() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_13`
warning: function `test_dynamicRef_14` should have a snake case name
--> tests/tests.rs:1996:4
|
1996 | fn test_dynamicRef_14() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_14`
warning: function `test_dynamicRef_15` should have a snake case name
--> tests/tests.rs:2002:4
|
2002 | fn test_dynamicRef_15() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_15`
warning: function `test_dynamicRef_16` should have a snake case name
--> tests/tests.rs:2008:4
|
2008 | fn test_dynamicRef_16() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_16`
warning: function `test_dynamicRef_17` should have a snake case name
--> tests/tests.rs:2014:4
|
2014 | fn test_dynamicRef_17() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_17`
warning: function `test_dynamicRef_18` should have a snake case name
--> tests/tests.rs:2020:4
|
2020 | fn test_dynamicRef_18() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_18`
warning: function `test_dynamicRef_19` should have a snake case name
--> tests/tests.rs:2026:4
|
2026 | fn test_dynamicRef_19() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_19`
warning: function `test_dynamicRef_20` should have a snake case name
--> tests/tests.rs:2032:4
|
2032 | fn test_dynamicRef_20() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_20`
warning: `jspg` (test "tests") generated 132 warnings
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.42s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
thread 'test_ref_39' (14864151) panicked at tests/tests.rs:1812:45:
called `Result::unwrap()` on an `Err` value: "[implicit keyword shadowing] Test 'child type overrides parent type' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'age'\", details: ErrorDetails { path: \"/age\" } }]\n[implicit keyword shadowing] Test 'parent max age (20) is shadowed (replaced) by child definition' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'age'\", details: ErrorDetails { path: \"/age\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_ref_39 ... FAILED
failures:
failures:
test_ref_39
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.01s
error: test failed, to rerun pass `--test tests`

44
debug_2.log Normal file
View File

@ -0,0 +1,44 @@
Blocking waiting for file lock on artifact directory
Compiling jspg v0.1.0 (/Users/awgneo/Repositories/thoughtpatterns/cellular/jspg)
error[E0424]: expected value, found module `self`
--> src/util.rs:162:33
|
40 | pub fn run_test_file_at_index(path: &str, index: usi...
| ---------------------- this function can't have a `self` parameter
...
162 | let mut new_overrides = self.overrides.clone();
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
error[E0424]: expected value, found module `self`
--> src/util.rs:164:31
|
40 | pub fn run_test_file_at_index(path: &str, index: usi...
| ---------------------- this function can't have a `self` parameter
...
164 | if let Some(props) = &self.schema.properties {
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
error[E0282]: type annotations needed
--> src/util.rs:166:32
|
166 | new_overrides.extend(props.keys().cloned());
| ^^^^^ cannot infer type
error[E0599]: no method named `is_valid` found for struct `drop::Drop` in the current scope
--> src/util.rs:204:18
|
204 | ...ult.is_valid(), // Use is_valid() for clear "Got"...
| ^^^^^^^^ method not found in `drop::Drop`
|
::: src/drop.rs:5:1
|
5 | pub struct Drop {
| --------------- method `is_valid` not found for this struct
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `is_valid`, perhaps you need to implement it:
candidate #1: `NullLayout`
Some errors have detailed explanations: E0282, E0424, E0599.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `jspg` (lib) due to 4 previous errors

815
debug_3.log Normal file
View File

@ -0,0 +1,815 @@
Blocking waiting for file lock on artifact directory
Compiling jspg v0.1.0 (/Users/awgneo/Repositories/thoughtpatterns/cellular/jspg)
warning: function `test_uniqueItems_0` should have a snake case name
--> tests/tests.rs:52:4
|
52 | fn test_uniqueItems_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_0`
|
= note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default
warning: function `test_uniqueItems_1` should have a snake case name
--> tests/tests.rs:58:4
|
58 | fn test_uniqueItems_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_1`
warning: function `test_uniqueItems_2` should have a snake case name
--> tests/tests.rs:64:4
|
64 | fn test_uniqueItems_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_2`
warning: function `test_uniqueItems_3` should have a snake case name
--> tests/tests.rs:70:4
|
70 | fn test_uniqueItems_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_3`
warning: function `test_uniqueItems_4` should have a snake case name
--> tests/tests.rs:76:4
|
76 | fn test_uniqueItems_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_4`
warning: function `test_uniqueItems_5` should have a snake case name
--> tests/tests.rs:82:4
|
82 | fn test_uniqueItems_5() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_5`
warning: function `test_uniqueItems_6` should have a snake case name
--> tests/tests.rs:88:4
|
88 | fn test_uniqueItems_6() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_unique_items_6`
warning: function `test_minItems_0` should have a snake case name
--> tests/tests.rs:94:4
|
94 | fn test_minItems_0() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_0`
warning: function `test_minItems_1` should have a snake case name
--> tests/tests.rs:100:4
|
100 | fn test_minItems_1() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_1`
warning: function `test_minItems_2` should have a snake case name
--> tests/tests.rs:106:4
|
106 | fn test_minItems_2() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_items_2`
warning: function `test_exclusiveMinimum_0` should have a snake case name
--> tests/tests.rs:160:4
|
160 | fn test_exclusiveMinimum_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_exclusive_minimum_0`
warning: function `test_anyOf_0` should have a snake case name
--> tests/tests.rs:274:4
|
274 | fn test_anyOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_0`
warning: function `test_anyOf_1` should have a snake case name
--> tests/tests.rs:280:4
|
280 | fn test_anyOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_1`
warning: function `test_anyOf_2` should have a snake case name
--> tests/tests.rs:286:4
|
286 | fn test_anyOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_2`
warning: function `test_anyOf_3` should have a snake case name
--> tests/tests.rs:292:4
|
292 | fn test_anyOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_3`
warning: function `test_anyOf_4` should have a snake case name
--> tests/tests.rs:298:4
|
298 | fn test_anyOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_4`
warning: function `test_anyOf_5` should have a snake case name
--> tests/tests.rs:304:4
|
304 | fn test_anyOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_5`
warning: function `test_anyOf_6` should have a snake case name
--> tests/tests.rs:310:4
|
310 | fn test_anyOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_6`
warning: function `test_anyOf_7` should have a snake case name
--> tests/tests.rs:316:4
|
316 | fn test_anyOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_7`
warning: function `test_anyOf_8` should have a snake case name
--> tests/tests.rs:322:4
|
322 | fn test_anyOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_8`
warning: function `test_anyOf_9` should have a snake case name
--> tests/tests.rs:328:4
|
328 | fn test_anyOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_any_of_9`
warning: function `test_propertyNames_0` should have a snake case name
--> tests/tests.rs:334:4
|
334 | fn test_propertyNames_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_0`
warning: function `test_propertyNames_1` should have a snake case name
--> tests/tests.rs:340:4
|
340 | fn test_propertyNames_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_1`
warning: function `test_propertyNames_2` should have a snake case name
--> tests/tests.rs:346:4
|
346 | fn test_propertyNames_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_2`
warning: function `test_propertyNames_3` should have a snake case name
--> tests/tests.rs:352:4
|
352 | fn test_propertyNames_3() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_3`
warning: function `test_propertyNames_4` should have a snake case name
--> tests/tests.rs:358:4
|
358 | fn test_propertyNames_4() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_4`
warning: function `test_propertyNames_5` should have a snake case name
--> tests/tests.rs:364:4
|
364 | fn test_propertyNames_5() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_5`
warning: function `test_propertyNames_6` should have a snake case name
--> tests/tests.rs:370:4
|
370 | fn test_propertyNames_6() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_property_names_6`
warning: function `test_minProperties_0` should have a snake case name
--> tests/tests.rs:646:4
|
646 | fn test_minProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_0`
warning: function `test_minProperties_1` should have a snake case name
--> tests/tests.rs:652:4
|
652 | fn test_minProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_1`
warning: function `test_minProperties_2` should have a snake case name
--> tests/tests.rs:658:4
|
658 | fn test_minProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_properties_2`
warning: function `test_minContains_0` should have a snake case name
--> tests/tests.rs:664:4
|
664 | fn test_minContains_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_0`
warning: function `test_minContains_1` should have a snake case name
--> tests/tests.rs:670:4
|
670 | fn test_minContains_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_1`
warning: function `test_minContains_2` should have a snake case name
--> tests/tests.rs:676:4
|
676 | fn test_minContains_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_2`
warning: function `test_minContains_3` should have a snake case name
--> tests/tests.rs:682:4
|
682 | fn test_minContains_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_3`
warning: function `test_minContains_4` should have a snake case name
--> tests/tests.rs:688:4
|
688 | fn test_minContains_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_4`
warning: function `test_minContains_5` should have a snake case name
--> tests/tests.rs:694:4
|
694 | fn test_minContains_5() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_5`
warning: function `test_minContains_6` should have a snake case name
--> tests/tests.rs:700:4
|
700 | fn test_minContains_6() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_6`
warning: function `test_minContains_7` should have a snake case name
--> tests/tests.rs:706:4
|
706 | fn test_minContains_7() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_7`
warning: function `test_minContains_8` should have a snake case name
--> tests/tests.rs:712:4
|
712 | fn test_minContains_8() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_contains_8`
warning: function `test_maxContains_0` should have a snake case name
--> tests/tests.rs:796:4
|
796 | fn test_maxContains_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_0`
warning: function `test_maxContains_1` should have a snake case name
--> tests/tests.rs:802:4
|
802 | fn test_maxContains_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_1`
warning: function `test_maxContains_2` should have a snake case name
--> tests/tests.rs:808:4
|
808 | fn test_maxContains_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_2`
warning: function `test_maxContains_3` should have a snake case name
--> tests/tests.rs:814:4
|
814 | fn test_maxContains_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_3`
warning: function `test_maxContains_4` should have a snake case name
--> tests/tests.rs:820:4
|
820 | fn test_maxContains_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_contains_4`
warning: function `test_maxLength_0` should have a snake case name
--> tests/tests.rs:826:4
|
826 | fn test_maxLength_0() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_length_0`
warning: function `test_maxLength_1` should have a snake case name
--> tests/tests.rs:832:4
|
832 | fn test_maxLength_1() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_length_1`
warning: function `test_dependentSchemas_0` should have a snake case name
--> tests/tests.rs:838:4
|
838 | fn test_dependentSchemas_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_0`
warning: function `test_dependentSchemas_1` should have a snake case name
--> tests/tests.rs:844:4
|
844 | fn test_dependentSchemas_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_1`
warning: function `test_dependentSchemas_2` should have a snake case name
--> tests/tests.rs:850:4
|
850 | fn test_dependentSchemas_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_2`
warning: function `test_dependentSchemas_3` should have a snake case name
--> tests/tests.rs:856:4
|
856 | fn test_dependentSchemas_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_schemas_3`
warning: function `test_exclusiveMaximum_0` should have a snake case name
--> tests/tests.rs:862:4
|
862 | fn test_exclusiveMaximum_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_exclusive_maximum_0`
warning: function `test_prefixItems_0` should have a snake case name
--> tests/tests.rs:868:4
|
868 | fn test_prefixItems_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_0`
warning: function `test_prefixItems_1` should have a snake case name
--> tests/tests.rs:874:4
|
874 | fn test_prefixItems_1() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_1`
warning: function `test_prefixItems_2` should have a snake case name
--> tests/tests.rs:880:4
|
880 | fn test_prefixItems_2() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_2`
warning: function `test_prefixItems_3` should have a snake case name
--> tests/tests.rs:886:4
|
886 | fn test_prefixItems_3() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_3`
warning: function `test_prefixItems_4` should have a snake case name
--> tests/tests.rs:892:4
|
892 | fn test_prefixItems_4() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_prefix_items_4`
warning: function `test_oneOf_0` should have a snake case name
--> tests/tests.rs:910:4
|
910 | fn test_oneOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_0`
warning: function `test_oneOf_1` should have a snake case name
--> tests/tests.rs:916:4
|
916 | fn test_oneOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_1`
warning: function `test_oneOf_2` should have a snake case name
--> tests/tests.rs:922:4
|
922 | fn test_oneOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_2`
warning: function `test_oneOf_3` should have a snake case name
--> tests/tests.rs:928:4
|
928 | fn test_oneOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_3`
warning: function `test_oneOf_4` should have a snake case name
--> tests/tests.rs:934:4
|
934 | fn test_oneOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_4`
warning: function `test_oneOf_5` should have a snake case name
--> tests/tests.rs:940:4
|
940 | fn test_oneOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_5`
warning: function `test_oneOf_6` should have a snake case name
--> tests/tests.rs:946:4
|
946 | fn test_oneOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_6`
warning: function `test_oneOf_7` should have a snake case name
--> tests/tests.rs:952:4
|
952 | fn test_oneOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_7`
warning: function `test_oneOf_8` should have a snake case name
--> tests/tests.rs:958:4
|
958 | fn test_oneOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_8`
warning: function `test_oneOf_9` should have a snake case name
--> tests/tests.rs:964:4
|
964 | fn test_oneOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_9`
warning: function `test_oneOf_10` should have a snake case name
--> tests/tests.rs:970:4
|
970 | fn test_oneOf_10() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_10`
warning: function `test_oneOf_11` should have a snake case name
--> tests/tests.rs:976:4
|
976 | fn test_oneOf_11() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_11`
warning: function `test_oneOf_12` should have a snake case name
--> tests/tests.rs:982:4
|
982 | fn test_oneOf_12() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_one_of_12`
warning: function `test_emptyString_0` should have a snake case name
--> tests/tests.rs:1072:4
|
1072 | fn test_emptyString_0() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_empty_string_0`
warning: function `test_maxProperties_0` should have a snake case name
--> tests/tests.rs:1090:4
|
1090 | fn test_maxProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_0`
warning: function `test_maxProperties_1` should have a snake case name
--> tests/tests.rs:1096:4
|
1096 | fn test_maxProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_1`
warning: function `test_maxProperties_2` should have a snake case name
--> tests/tests.rs:1102:4
|
1102 | fn test_maxProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_2`
warning: function `test_maxProperties_3` should have a snake case name
--> tests/tests.rs:1108:4
|
1108 | fn test_maxProperties_3() {
| ^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_properties_3`
warning: function `test_dependentRequired_0` should have a snake case name
--> tests/tests.rs:1114:4
|
1114 | fn test_dependentRequired_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_0`
warning: function `test_dependentRequired_1` should have a snake case name
--> tests/tests.rs:1120:4
|
1120 | fn test_dependentRequired_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_1`
warning: function `test_dependentRequired_2` should have a snake case name
--> tests/tests.rs:1126:4
|
1126 | fn test_dependentRequired_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_2`
warning: function `test_dependentRequired_3` should have a snake case name
--> tests/tests.rs:1132:4
|
1132 | fn test_dependentRequired_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_3`
warning: function `test_dependentRequired_4` should have a snake case name
--> tests/tests.rs:1138:4
|
1138 | fn test_dependentRequired_4() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dependent_required_4`
warning: function `test_multipleOf_0` should have a snake case name
--> tests/tests.rs:1252:4
|
1252 | fn test_multipleOf_0() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_0`
warning: function `test_multipleOf_1` should have a snake case name
--> tests/tests.rs:1258:4
|
1258 | fn test_multipleOf_1() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_1`
warning: function `test_multipleOf_2` should have a snake case name
--> tests/tests.rs:1264:4
|
1264 | fn test_multipleOf_2() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_2`
warning: function `test_multipleOf_3` should have a snake case name
--> tests/tests.rs:1270:4
|
1270 | fn test_multipleOf_3() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_multiple_of_3`
warning: function `test_patternProperties_0` should have a snake case name
--> tests/tests.rs:1276:4
|
1276 | fn test_patternProperties_0() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_0`
warning: function `test_patternProperties_1` should have a snake case name
--> tests/tests.rs:1282:4
|
1282 | fn test_patternProperties_1() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_1`
warning: function `test_patternProperties_2` should have a snake case name
--> tests/tests.rs:1288:4
|
1288 | fn test_patternProperties_2() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_2`
warning: function `test_patternProperties_3` should have a snake case name
--> tests/tests.rs:1294:4
|
1294 | fn test_patternProperties_3() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_3`
warning: function `test_patternProperties_4` should have a snake case name
--> tests/tests.rs:1300:4
|
1300 | fn test_patternProperties_4() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_4`
warning: function `test_patternProperties_5` should have a snake case name
--> tests/tests.rs:1306:4
|
1306 | fn test_patternProperties_5() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_pattern_properties_5`
warning: function `test_allOf_0` should have a snake case name
--> tests/tests.rs:1336:4
|
1336 | fn test_allOf_0() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_0`
warning: function `test_allOf_1` should have a snake case name
--> tests/tests.rs:1342:4
|
1342 | fn test_allOf_1() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_1`
warning: function `test_allOf_2` should have a snake case name
--> tests/tests.rs:1348:4
|
1348 | fn test_allOf_2() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_2`
warning: function `test_allOf_3` should have a snake case name
--> tests/tests.rs:1354:4
|
1354 | fn test_allOf_3() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_3`
warning: function `test_allOf_4` should have a snake case name
--> tests/tests.rs:1360:4
|
1360 | fn test_allOf_4() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_4`
warning: function `test_allOf_5` should have a snake case name
--> tests/tests.rs:1366:4
|
1366 | fn test_allOf_5() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_5`
warning: function `test_allOf_6` should have a snake case name
--> tests/tests.rs:1372:4
|
1372 | fn test_allOf_6() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_6`
warning: function `test_allOf_7` should have a snake case name
--> tests/tests.rs:1378:4
|
1378 | fn test_allOf_7() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_7`
warning: function `test_allOf_8` should have a snake case name
--> tests/tests.rs:1384:4
|
1384 | fn test_allOf_8() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_8`
warning: function `test_allOf_9` should have a snake case name
--> tests/tests.rs:1390:4
|
1390 | fn test_allOf_9() {
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_9`
warning: function `test_allOf_10` should have a snake case name
--> tests/tests.rs:1396:4
|
1396 | fn test_allOf_10() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_10`
warning: function `test_allOf_11` should have a snake case name
--> tests/tests.rs:1402:4
|
1402 | fn test_allOf_11() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_11`
warning: function `test_allOf_12` should have a snake case name
--> tests/tests.rs:1408:4
|
1408 | fn test_allOf_12() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_12`
warning: function `test_allOf_13` should have a snake case name
--> tests/tests.rs:1414:4
|
1414 | fn test_allOf_13() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_13`
warning: function `test_allOf_14` should have a snake case name
--> tests/tests.rs:1420:4
|
1420 | fn test_allOf_14() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_14`
warning: function `test_allOf_15` should have a snake case name
--> tests/tests.rs:1426:4
|
1426 | fn test_allOf_15() {
| ^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_all_of_15`
warning: function `test_minLength_0` should have a snake case name
--> tests/tests.rs:1828:4
|
1828 | fn test_minLength_0() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_length_0`
warning: function `test_minLength_1` should have a snake case name
--> tests/tests.rs:1834:4
|
1834 | fn test_minLength_1() {
| ^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_min_length_1`
warning: function `test_maxItems_0` should have a snake case name
--> tests/tests.rs:1840:4
|
1840 | fn test_maxItems_0() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_0`
warning: function `test_maxItems_1` should have a snake case name
--> tests/tests.rs:1846:4
|
1846 | fn test_maxItems_1() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_1`
warning: function `test_maxItems_2` should have a snake case name
--> tests/tests.rs:1852:4
|
1852 | fn test_maxItems_2() {
| ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_max_items_2`
warning: function `test_dynamicRef_0` should have a snake case name
--> tests/tests.rs:1912:4
|
1912 | fn test_dynamicRef_0() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_0`
warning: function `test_dynamicRef_1` should have a snake case name
--> tests/tests.rs:1918:4
|
1918 | fn test_dynamicRef_1() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_1`
warning: function `test_dynamicRef_2` should have a snake case name
--> tests/tests.rs:1924:4
|
1924 | fn test_dynamicRef_2() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_2`
warning: function `test_dynamicRef_3` should have a snake case name
--> tests/tests.rs:1930:4
|
1930 | fn test_dynamicRef_3() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_3`
warning: function `test_dynamicRef_4` should have a snake case name
--> tests/tests.rs:1936:4
|
1936 | fn test_dynamicRef_4() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_4`
warning: function `test_dynamicRef_5` should have a snake case name
--> tests/tests.rs:1942:4
|
1942 | fn test_dynamicRef_5() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_5`
warning: function `test_dynamicRef_6` should have a snake case name
--> tests/tests.rs:1948:4
|
1948 | fn test_dynamicRef_6() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_6`
warning: function `test_dynamicRef_7` should have a snake case name
--> tests/tests.rs:1954:4
|
1954 | fn test_dynamicRef_7() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_7`
warning: function `test_dynamicRef_8` should have a snake case name
--> tests/tests.rs:1960:4
|
1960 | fn test_dynamicRef_8() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_8`
warning: function `test_dynamicRef_9` should have a snake case name
--> tests/tests.rs:1966:4
|
1966 | fn test_dynamicRef_9() {
| ^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_9`
warning: function `test_dynamicRef_10` should have a snake case name
--> tests/tests.rs:1972:4
|
1972 | fn test_dynamicRef_10() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_10`
warning: function `test_dynamicRef_11` should have a snake case name
--> tests/tests.rs:1978:4
|
1978 | fn test_dynamicRef_11() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_11`
warning: function `test_dynamicRef_12` should have a snake case name
--> tests/tests.rs:1984:4
|
1984 | fn test_dynamicRef_12() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_12`
warning: function `test_dynamicRef_13` should have a snake case name
--> tests/tests.rs:1990:4
|
1990 | fn test_dynamicRef_13() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_13`
warning: function `test_dynamicRef_14` should have a snake case name
--> tests/tests.rs:1996:4
|
1996 | fn test_dynamicRef_14() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_14`
warning: function `test_dynamicRef_15` should have a snake case name
--> tests/tests.rs:2002:4
|
2002 | fn test_dynamicRef_15() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_15`
warning: function `test_dynamicRef_16` should have a snake case name
--> tests/tests.rs:2008:4
|
2008 | fn test_dynamicRef_16() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_16`
warning: function `test_dynamicRef_17` should have a snake case name
--> tests/tests.rs:2014:4
|
2014 | fn test_dynamicRef_17() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_17`
warning: function `test_dynamicRef_18` should have a snake case name
--> tests/tests.rs:2020:4
|
2020 | fn test_dynamicRef_18() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_18`
warning: function `test_dynamicRef_19` should have a snake case name
--> tests/tests.rs:2026:4
|
2026 | fn test_dynamicRef_19() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_19`
warning: function `test_dynamicRef_20` should have a snake case name
--> tests/tests.rs:2032:4
|
2032 | fn test_dynamicRef_20() {
| ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `test_dynamic_ref_20`
warning: `jspg` (test "tests") generated 132 warnings
Finished `test` profile [unoptimized + debuginfo] target(s) in 6.12s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
thread 'test_ref_39' (14867888) panicked at tests/tests.rs:1812:45:
called `Result::unwrap()` on an `Err` value: "[implicit keyword shadowing] Test 'child type overrides parent type' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'age'\", details: ErrorDetails { path: \"/age\" } }]\n[implicit keyword shadowing] Test 'parent max age (20) is shadowed (replaced) by child definition' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'age'\", details: ErrorDetails { path: \"/age\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_ref_39 ... FAILED
failures:
failures:
test_ref_39
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test tests`

106
log_root.txt Normal file
View File

@ -0,0 +1,106 @@
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.34s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"job_id", "manager_id", "name"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"manager_id", "type", "job_id", "name"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"name", "job_id", "manager_id", "type"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"job_id", "name"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "name", "type"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name", "type"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "type", "name"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"name", "job_id", "manager_id", "nested_or_super_job", "type"}
DEBUG: check_strictness at . Extensible: false. Keys: {"root_job", "name", "job_id", "manager_id", "nested_or_super_job", "type"}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"name", "manager_id", "job_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"manager_id", "name", "type", "job_id"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"manager_id", "type", "job_id", "name"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"manager_id", "type", "name", "job_id"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "job_id", "type"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id", "type"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "type", "name"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"manager_id", "type", "nested_or_super_job", "name", "job_id"}
DEBUG: check_strictness at . Extensible: false. Keys: {"manager_id", "root_job", "type", "nested_or_super_job", "name", "job_id"}
DEBUG: validate_refs merging res from entity. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/my_job/name. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/my_job/type. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"type", "name"}
DEBUG: validate_refs merging res from job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: validate_object inserted 'my_job' at /nested_or_super_job/my_job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"job_id", "manager_id", "name"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "type", "manager_id", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
thread 'test_puncs_6' (15117383) panicked at tests/tests.rs:150:44:
called `Result::unwrap()` on an `Err` value: "[complex punc type matching with oneOf and nested refs] Test 'valid person against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'first_name'\", details: ErrorDetails { path: \"/first_name\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against strict punc' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_puncs_6 ... FAILED
failures:
failures:
test_puncs_6
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test tests`

106
puncs_6_fix.txt Normal file
View File

@ -0,0 +1,106 @@
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.39s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"name", "job_id", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "name", "manager_id", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"name", "manager_id", "job_id", "type"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"name", "manager_id", "job_id", "type"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"job_id", "name"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "type", "name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "type", "name"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "job_id", "type"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"name", "manager_id", "job_id", "type", "nested_or_super_job"}
DEBUG: check_strictness at . Extensible: false. Keys: {"name", "manager_id", "job_id", "type", "nested_or_super_job", "root_job"}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"job_id", "name", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "name", "type", "manager_id"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"type", "job_id", "manager_id", "name"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"job_id", "name", "manager_id", "type"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "type", "job_id"}
DEBUG: validate_refs merging res from job. Keys: {"name", "type", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"type", "name", "job_id"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"job_id", "name", "manager_id", "type", "nested_or_super_job"}
DEBUG: check_strictness at . Extensible: false. Keys: {"root_job", "job_id", "name", "manager_id", "type", "nested_or_super_job"}
DEBUG: validate_refs merging res from entity. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/my_job/name. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/my_job/type. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: validate_refs merging res from job. Keys: {"name", "type"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: validate_object inserted 'my_job' at /nested_or_super_job/my_job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"job_id", "name", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
thread 'test_puncs_6' (15118678) panicked at tests/tests.rs:150:44:
called `Result::unwrap()` on an `Err` value: "[complex punc type matching with oneOf and nested refs] Test 'valid person against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'first_name'\", details: ErrorDetails { path: \"/first_name\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against strict punc' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_puncs_6 ... FAILED
failures:
failures:
test_puncs_6
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.01s
error: test failed, to rerun pass `--test tests`

103
puncs_6_full.txt Normal file
View File

@ -0,0 +1,103 @@
Blocking waiting for file lock on artifact directory
Compiling jspg v0.1.0 (/Users/awgneo/Repositories/thoughtpatterns/cellular/jspg)
Finished `test` profile [unoptimized + debuginfo] target(s) in 7.63s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"name", "job_id", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"manager_id", "type", "name", "job_id"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"name", "job_id", "manager_id", "type"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "job_id", "type"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id", "type"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "type", "name"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"name", "job_id", "nested_or_super_job", "manager_id", "type"}
DEBUG: check_strictness at . Extensible: false. Keys: {"root_job", "name", "job_id", "nested_or_super_job", "manager_id", "type"}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"job_id", "manager_id", "name"}
DEBUG: validate_refs merging res from super_job. Keys: {"type", "job_id", "manager_id", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"name", "manager_id", "job_id", "type"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "type", "job_id"}
DEBUG: validate_refs merging res from job. Keys: {"name", "type", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"type", "job_id", "name"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"name", "manager_id", "job_id", "type", "nested_or_super_job"}
DEBUG: check_strictness at . Extensible: false. Keys: {"name", "root_job", "manager_id", "job_id", "type", "nested_or_super_job"}
DEBUG: validate_refs merging res from entity. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/my_job/name. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/my_job/type. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: validate_refs merging res from job. Keys: {"name", "type"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"type", "name"}
DEBUG: validate_object inserted 'my_job' at /nested_or_super_job/my_job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"name", "job_id", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "manager_id", "name", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: check_strictness at . Extensible: false. Keys: {}
thread 'test_puncs_6' (15113120) panicked at tests/tests.rs:150:44:
called `Result::unwrap()` on an `Err` value: "[complex punc type matching with oneOf and nested refs] Test 'valid person against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'first_name'\", details: ErrorDetails { path: \"/first_name\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against strict punc' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_puncs_6 ... FAILED
failures:
failures:
test_puncs_6
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.01s
error: test failed, to rerun pass `--test tests`

57
puncs_6_output.txt Normal file
View File

@ -0,0 +1,57 @@
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.47s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "type", "manager_id", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"type", "name", "manager_id", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {"manager_id", "type", "job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"manager_id", "job_id", "type", "name"}
DEBUG: validate_refs merging res from entity. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/my_job/name
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job/type. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"type", "name"}
DEBUG: validate_refs merging res from job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {"manager_id", "type", "name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
thread 'test_puncs_6' (15109801) panicked at tests/tests.rs:150:44:
called `Result::unwrap()` on an `Err` value: "[complex punc type matching with oneOf and nested refs] Test 'valid person against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'first_name'\", details: ErrorDetails { path: \"/first_name\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against strict punc' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_puncs_6 ... FAILED
failures:
failures:
test_puncs_6
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test tests`

106
puncs_6_resolved.txt Normal file
View File

@ -0,0 +1,106 @@
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.41s
Running tests/tests.rs (target/debug/deps/tests-0f6b1e496850f0af)
running 1 test
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"name", "job_id", "manager_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"name", "job_id", "manager_id", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"name", "manager_id", "job_id", "type"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "job_id", "type"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id", "type"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"job_id", "type", "name"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"job_id", "nested_or_super_job", "manager_id", "type", "name"}
DEBUG: check_strictness at . Extensible: false. Keys: {"job_id", "nested_or_super_job", "manager_id", "type", "name", "root_job"}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"manager_id", "name", "job_id"}
DEBUG: validate_refs merging res from super_job. Keys: {"manager_id", "name", "job_id", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: validate_object inserted 'nested_or_super_job' at /nested_or_super_job. Keys: {"type", "manager_id", "job_id", "name"}
DEBUG: check_strictness at /root_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /root_job/name. Keys: {}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /root_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /root_job/job_id. Keys: {"name"}
DEBUG: check_strictness at /root_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /root_job/type. Keys: {"name", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"name", "type", "job_id"}
DEBUG: validate_refs merging res from job. Keys: {"name", "type", "job_id"}
DEBUG: check_strictness at /root_job. Extensible: false. Keys: {"type", "name", "job_id"}
DEBUG: validate_object inserted 'root_job' at /root_job. Keys: {"type", "manager_id", "job_id", "name", "nested_or_super_job"}
DEBUG: check_strictness at . Extensible: false. Keys: {"type", "root_job", "manager_id", "job_id", "name", "nested_or_super_job"}
DEBUG: validate_refs merging res from entity. Keys: {}
DEBUG: validate_refs merging res from job. Keys: {}
DEBUG: validate_refs merging res from super_job. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/my_job/name. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name"}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/my_job/type. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"type", "name"}
DEBUG: validate_refs merging res from job. Keys: {"type", "name"}
DEBUG: check_strictness at /nested_or_super_job/my_job. Extensible: false. Keys: {"name", "type"}
DEBUG: validate_object inserted 'my_job' at /nested_or_super_job/my_job. Keys: {"name", "type"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: check_strictness at /nested_or_super_job/name. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'name' at /nested_or_super_job/name. Keys: {}
DEBUG: validate_refs merging res from entity. Keys: {"name"}
DEBUG: check_strictness at /nested_or_super_job/job_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'job_id' at /nested_or_super_job/job_id. Keys: {"name"}
DEBUG: validate_refs merging res from job. Keys: {"name", "job_id"}
DEBUG: check_strictness at /nested_or_super_job/manager_id. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'manager_id' at /nested_or_super_job/manager_id. Keys: {"job_id", "name"}
DEBUG: check_strictness at /nested_or_super_job/type. Extensible: false. Keys: {}
DEBUG: validate_object inserted 'type' at /nested_or_super_job/type. Keys: {"manager_id", "job_id", "name"}
DEBUG: validate_refs merging res from super_job. Keys: {"job_id", "manager_id", "type", "name"}
DEBUG: check_strictness at /nested_or_super_job. Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("polymorphic_org_punc.request") ref=Some("organization.family")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
DEBUG: VALIDATE ROOT: id=Some("strict_org_punc.request") ref=Some("organization")
DEBUG: check_strictness at . Extensible: false. Keys: {}
thread 'test_puncs_6' (15121282) panicked at tests/tests.rs:150:44:
called `Result::unwrap()` on an `Err` value: "[complex punc type matching with oneOf and nested refs] Test 'valid person against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'first_name'\", details: ErrorDetails { path: \"/first_name\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against organization punc (polymorphic)' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]\n[complex punc type matching with oneOf and nested refs] Test 'valid organization against strict punc' failed. Expected: true, Got: true. Errors: [Error { punc: None, code: \"STRICT_PROPERTY_VIOLATION\", message: \"Unexpected property 'id'\", details: ErrorDetails { path: \"/id\" } }]"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test test_puncs_6 ... FAILED
failures:
failures:
test_puncs_6
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 338 filtered out; finished in 0.01s
error: test failed, to rerun pass `--test tests`

View File

@ -1,7 +1,7 @@
use crate::schema::Schema;
use regex::Regex;
use serde_json::Value;
use std::collections::HashMap;
// use std::collections::HashMap;
use std::error::Error;
use std::sync::Arc;
@ -14,14 +14,6 @@ pub enum CompiledFormat {
Regex(Regex),
}
/// A fully compiled schema with a root node and a pre-calculated index map.
/// This allows O(1) lookup of any anchor or $id within the schema tree.
#[derive(Debug, Clone)]
pub struct CompiledSchema {
pub root: Arc<Schema>,
pub index: HashMap<String, Arc<Schema>>,
}
/// A wrapper for compiled regex patterns
#[derive(Debug, Clone)]
pub struct CompiledRegex(pub Regex);
@ -169,10 +161,10 @@ impl Compiler {
}
}
/// Recursively traverses the schema tree to build a map of all internal Anchors ($id) and JSON Pointers.
/// Recursively traverses the schema tree to build the local registry index.
fn compile_index(
schema: &Arc<Schema>,
index: &mut HashMap<String, Arc<Schema>>,
registry: &mut crate::registry::Registry,
parent_base: Option<String>,
pointer: json_pointer::JsonPointer<String, Vec<String>>,
) {
@ -186,15 +178,14 @@ impl Compiler {
} else {
format!("{}#{}", base, fragment)
};
index.insert(ptr_uri, schema.clone());
registry.insert(ptr_uri, schema.clone());
}
// 2. Determine Current Scope... (unchanged logic, just use pointer)
// 2. Determine Current Scope... (unchanged logic)
let mut current_base = parent_base.clone();
let mut child_pointer = pointer.clone();
if let Some(id) = &schema.obj.id {
// ... resolve ID logic ...
let mut new_base = None;
if let Ok(_) = url::Url::parse(id) {
new_base = Some(id.clone());
@ -209,40 +200,29 @@ impl Compiler {
}
if let Some(base) = new_base {
index.insert(base.clone(), schema.clone());
// println!("DEBUG: Compiling index for path: {}", base); // Added println
registry.insert(base.clone(), schema.clone());
current_base = Some(base);
child_pointer = json_pointer::JsonPointer::new(vec![]); // Reset
}
}
// 3. Index by Anchor (unchanged)
if let Some(anchor) = &schema.obj.anchor {
if let Some(base) = &current_base {
let anchor_uri = format!("{}#{}", base, anchor);
index.insert(anchor_uri, schema.clone());
}
}
// Index by Dynamic Anchor
if let Some(d_anchor) = &schema.obj.dynamic_anchor {
if let Some(base) = &current_base {
let anchor_uri = format!("{}#{}", base, d_anchor);
index.insert(anchor_uri.clone(), schema.clone());
println!("Indexed Dynamic Anchor: {}", anchor_uri);
}
}
// 3. Index by Anchor
if let Some(anchor) = &schema.obj.anchor {
if let Some(base) = &current_base {
let anchor_uri = format!("{}#{}", base, anchor);
index.insert(anchor_uri.clone(), schema.clone());
println!("Indexed Anchor: {}", anchor_uri);
registry.insert(anchor_uri, schema.clone());
}
}
// Index by Dynamic Anchor
if let Some(d_anchor) = &schema.obj.dynamic_anchor {
if let Some(base) = &current_base {
let anchor_uri = format!("{}#{}", base, d_anchor);
registry.insert(anchor_uri, schema.clone());
}
}
// ... (Const/Enum indexing skipped for brevity, relies on string)
// 4. Recurse
// 4. Recurse (unchanged logic structure, just passing registry)
if let Some(defs) = schema.defs.as_ref().or(schema.definitions.as_ref()) {
let segment = if schema.defs.is_some() {
"$defs"
@ -252,10 +232,9 @@ impl Compiler {
for (key, sub_schema) in defs {
let mut sub = child_pointer.clone();
sub.push(segment.to_string());
// Decode key to avoid double encoding by JsonPointer
let decoded_key = percent_encoding::percent_decode_str(key).decode_utf8_lossy();
sub.push(decoded_key.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
@ -264,14 +243,14 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("properties".to_string());
sub.push(key.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(items) = &schema.items {
let mut sub = child_pointer.clone();
sub.push("items".to_string());
Self::compile_index(items, index, current_base.clone(), sub);
Self::compile_index(items, registry, current_base.clone(), sub);
}
if let Some(prefix_items) = &schema.prefix_items {
@ -279,7 +258,7 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("prefixItems".to_string());
sub.push(i.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
@ -288,7 +267,7 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("allOf".to_string());
sub.push(i.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(any_of) = &schema.any_of {
@ -296,7 +275,7 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("anyOf".to_string());
sub.push(i.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(one_of) = &schema.one_of {
@ -304,36 +283,36 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("oneOf".to_string());
sub.push(i.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(not) = &schema.not {
let mut sub = child_pointer.clone();
sub.push("not".to_string());
Self::compile_index(not, index, current_base.clone(), sub);
Self::compile_index(not, registry, current_base.clone(), sub);
}
if let Some(if_) = &schema.if_ {
let mut sub = child_pointer.clone();
sub.push("if".to_string());
Self::compile_index(if_, index, current_base.clone(), sub);
Self::compile_index(if_, registry, current_base.clone(), sub);
}
if let Some(then_) = &schema.then_ {
let mut sub = child_pointer.clone();
sub.push("then".to_string());
Self::compile_index(then_, index, current_base.clone(), sub);
Self::compile_index(then_, registry, current_base.clone(), sub);
}
if let Some(else_) = &schema.else_ {
let mut sub = child_pointer.clone();
sub.push("else".to_string());
Self::compile_index(else_, index, current_base.clone(), sub);
Self::compile_index(else_, registry, current_base.clone(), sub);
}
if let Some(deps) = &schema.dependent_schemas {
for (key, sub_schema) in deps {
let mut sub = child_pointer.clone();
sub.push("dependentSchemas".to_string());
sub.push(key.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(pp) = &schema.pattern_properties {
@ -341,55 +320,67 @@ impl Compiler {
let mut sub = child_pointer.clone();
sub.push("patternProperties".to_string());
sub.push(key.to_string());
Self::compile_index(sub_schema, index, current_base.clone(), sub);
Self::compile_index(sub_schema, registry, current_base.clone(), sub);
}
}
if let Some(contains) = &schema.contains {
let mut sub = child_pointer.clone();
sub.push("contains".to_string());
Self::compile_index(contains, index, current_base.clone(), sub);
Self::compile_index(contains, registry, current_base.clone(), sub);
}
if let Some(property_names) = &schema.property_names {
let mut sub = child_pointer.clone();
sub.push("propertyNames".to_string());
Self::compile_index(property_names, index, current_base.clone(), sub);
Self::compile_index(property_names, registry, current_base.clone(), sub);
}
}
/// Resolves a format string to a CompiledFormat (future optimization)
pub fn compile_format(_format: &str) -> Option<CompiledFormat> {
None
}
pub fn compile(mut root_schema: Schema, root_id: Option<String>) -> CompiledSchema {
// 1. Compile in-place (formats/regexes)
pub fn compile(mut root_schema: Schema, root_id: Option<String>) -> Arc<Schema> {
// 1. Compile in-place (formats/regexes/normalization)
Self::compile_formats_and_regexes(&mut root_schema);
// Apply root_id override if schema ID is missing
if let Some(ref rid) = root_id {
if let Some(rid) = &root_id {
if root_schema.obj.id.is_none() {
root_schema.obj.id = Some(rid.clone());
}
}
// 2. Wrap in Arc
let root = Arc::new(root_schema);
let mut index = HashMap::new();
// 2. Build ID/Pointer Index
let mut registry = crate::registry::Registry::new();
// We need a temporary Arc to satisfy compile_index recursion
// But we are modifying root_schema.
// This is tricky. compile_index takes &Arc<Schema>.
// We should build the index first, THEN attach it.
let root = Arc::new(root_schema);
// Default base_uri to ""
let base_uri = root_id
.clone()
.or_else(|| root.obj.id.clone())
.or(Some("".to_string()));
// 3. Build ID/Pointer Index
// Default base_uri to "" so that pointers like "#/foo" are indexed even if no root ID exists
Self::compile_index(
&root,
&mut index,
root_id.clone().or(Some("".to_string())),
&mut registry,
base_uri,
json_pointer::JsonPointer::new(vec![]),
);
// Also ensure root id is indexed if present
if let Some(rid) = root_id {
index.insert(rid, root.clone());
registry.insert(rid, root.clone());
}
CompiledSchema { root, index }
// Now we need to attach this registry to the root schema.
// Since root is an Arc, we might need to recreate it if we can't mutate.
// Schema struct modifications require &mut.
let mut final_schema = Arc::try_unwrap(root).unwrap_or_else(|arc| (*arc).clone());
final_schema.obj.compiled_schemas = Some(Arc::new(registry));
Arc::new(final_schema)
}
}

View File

@ -1,4 +1,4 @@
use crate::compiler::CompiledSchema; // Changed from crate::schema::Schema
use crate::schema::Schema;
use lazy_static::lazy_static;
use std::collections::HashMap;
use std::sync::RwLock;
@ -9,8 +9,9 @@ lazy_static! {
use std::sync::Arc;
#[derive(Debug, Clone, Default)]
pub struct Registry {
pub schemas: HashMap<String, Arc<CompiledSchema>>, // Changed from Schema
pub schemas: HashMap<String, Arc<Schema>>,
}
impl Registry {
@ -20,14 +21,12 @@ impl Registry {
}
}
pub fn insert(&mut self, id: String, compiled: CompiledSchema) {
if self.schemas.contains_key(&id) {
panic!("Duplicate schema ID inserted into registry: '{}'", id);
}
self.schemas.insert(id, Arc::new(compiled));
pub fn insert(&mut self, id: String, schema: Arc<Schema>) {
// We allow overwriting for now to support re-compilation in tests/dev
self.schemas.insert(id, schema);
}
pub fn get(&self, id: &str) -> Option<Arc<CompiledSchema>> {
pub fn get(&self, id: &str) -> Option<Arc<Schema>> {
self.schemas.get(id).cloned()
}

View File

@ -34,7 +34,6 @@ pub struct SchemaObject {
#[serde(rename = "patternProperties")]
pub pattern_properties: Option<BTreeMap<String, Arc<Schema>>>,
pub required: Option<Vec<String>>,
// additionalProperties can be checks against a schema or boolean (handled by Schema wrapper)
// dependencies can be schema dependencies or property dependencies
pub dependencies: Option<BTreeMap<String, Dependency>>,
@ -88,7 +87,11 @@ pub struct SchemaObject {
pub format: Option<String>,
#[serde(rename = "enum")]
pub enum_: Option<Vec<Value>>, // `enum` is a reserved keyword in Rust
#[serde(default, rename = "const")]
#[serde(
default,
rename = "const",
deserialize_with = "crate::util::deserialize_some"
)]
pub const_: Option<Value>,
// Numeric Validation
@ -135,6 +138,8 @@ pub struct SchemaObject {
pub compiled_pattern: Option<crate::compiler::CompiledRegex>,
#[serde(skip)]
pub compiled_pattern_properties: Option<Vec<(crate::compiler::CompiledRegex, Arc<Schema>)>>,
#[serde(skip)]
pub compiled_schemas: Option<Arc<crate::registry::Registry>>,
}
#[derive(Debug, Clone, Serialize)]
@ -183,7 +188,7 @@ impl<'de> Deserialize<'de> for Schema {
always_fail: !b,
});
}
let obj: SchemaObject = serde_json::from_value(v).map_err(serde::de::Error::custom)?;
let obj: SchemaObject = serde_json::from_value(v.clone()).map_err(serde::de::Error::custom)?;
Ok(Schema {
obj,

File diff suppressed because it is too large Load Diff

View File

@ -39,10 +39,10 @@ where
pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
// Clear registry to ensure isolation
{
let mut registry = REGISTRY.write().unwrap();
registry.clear();
}
// {
// let mut registry = REGISTRY.write().unwrap();
// registry.clear();
// }
let content =
fs::read_to_string(path).unwrap_or_else(|_| panic!("Failed to read file: {}", path));
@ -56,8 +56,10 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
let group = &suite[index];
let mut failures = Vec::<String>::new();
let mut registry = crate::registry::Registry::new();
// Helper to register items with 'schemas'
let register_schemas = |items_val: Option<&Value>| {
let register_schemas = |registry: &mut crate::registry::Registry, items_val: Option<&Value>| {
if let Some(val) = items_val {
if let Value::Array(arr) = val {
for item in arr {
@ -69,8 +71,6 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
{
// Clone ID upfront to avoid borrow issues
if let Some(id_clone) = schema.obj.id.clone() {
let mut registry = REGISTRY.write().unwrap();
// Utilize the new compile method which handles strictness
let compiled =
crate::compiler::Compiler::compile(schema, Some(id_clone.clone()));
registry.insert(id_clone, compiled);
@ -118,7 +118,6 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
});
if let Ok(schema) = serde_json::from_value::<crate::schema::Schema>(schema_json) {
let mut registry = REGISTRY.write().unwrap();
let compiled = crate::compiler::Compiler::compile(schema, Some(id.clone()));
registry.insert(id, compiled);
}
@ -127,32 +126,40 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
}
// 2. Register items directly
register_schemas(group.enums.as_ref());
register_schemas(group.types.as_ref());
register_schemas(group.puncs.as_ref());
register_schemas(&mut registry, group.enums.as_ref());
register_schemas(&mut registry, group.types.as_ref());
register_schemas(&mut registry, group.puncs.as_ref());
// 3. Register root 'schemas' if present (generic test support)
// Some tests use a raw 'schema' or 'schemas' field at the group level
if let Some(schema_val) = &group.schema {
if let Ok(schema) = serde_json::from_value::<crate::schema::Schema>(schema_val.clone()) {
let id = schema
.obj
.id
.clone()
.or_else(|| {
// Fallback ID if none provided in schema
Some("root".to_string())
})
.unwrap();
match serde_json::from_value::<crate::schema::Schema>(schema_val.clone()) {
Ok(schema) => {
let id = schema
.obj
.id
.clone()
.or_else(|| {
// Fallback ID if none provided in schema
Some(format!("test:{}:{}", path, index))
})
.unwrap();
let mut registry = REGISTRY.write().unwrap();
let compiled = crate::compiler::Compiler::compile(schema, Some(id.clone()));
registry.insert(id, compiled);
let mut registry_ref = &mut registry;
let compiled = crate::compiler::Compiler::compile(schema, Some(id.clone()));
registry_ref.insert(id, compiled);
}
Err(e) => {
eprintln!(
"DEBUG: FAILED to deserialize group schema for index {}: {}",
index, e
);
}
}
}
// 4. Run Tests
for (test_index, test) in group.tests.iter().enumerate() {
for (_test_index, test) in group.tests.iter().enumerate() {
let mut schema_id = test.schema_id.clone();
// If no explicit schema_id, try to infer from the single schema in the group
@ -165,7 +172,7 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
}
}
if schema_id.is_none() {
schema_id = Some("root".to_string());
schema_id = Some(format!("test:{}:{}", path, index));
}
}
}
@ -186,7 +193,7 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
}
if let Some(sid) = schema_id {
let result = Validator::validate(&sid, &test.data);
let result = Validator::validate_with_registry(&sid, &test.data, &registry);
if !result.errors.is_empty() != !test.valid {
failures.push(format!(
@ -194,7 +201,7 @@ pub fn run_test_file_at_index(path: &str, index: usize) -> Result<(), String> {
group.description,
test.description,
test.valid,
!result.errors.is_empty(),
!result.errors.is_empty(), // "Got Invalid?"
result.errors
));
}

View File

@ -1,12 +1,10 @@
use crate::compiler::CompiledSchema;
use crate::registry::REGISTRY;
use crate::schema::Schema;
use percent_encoding;
use regex::Regex;
use serde_json::Value;
use std::collections::{BTreeMap, HashSet};
use std::sync::Arc;
use std::collections::HashSet;
#[derive(Debug, Clone)]
pub struct ValidationError {
@ -15,10 +13,9 @@ pub struct ValidationError {
pub path: String,
}
#[derive(Debug)]
pub enum ResolvedRef<'a> {
Local(&'a Schema),
External(Arc<CompiledSchema>, Arc<Schema>),
Global(&'a Schema, &'a Schema),
}
#[derive(Debug, Default, Clone)]
@ -46,7 +43,7 @@ impl ValidationResult {
pub struct ValidationContext<'a> {
// 1. Global (The Library)
pub root: &'a CompiledSchema,
pub root: &'a Schema,
// 2. The Instruction (The Rule)
pub schema: &'a Schema,
@ -63,16 +60,19 @@ pub struct ValidationContext<'a> {
pub overrides: HashSet<String>, // Keywords explicitly defined by callers that I should skip (Inherited Mask)
pub extensible: bool,
pub reporter: bool, // If true, we only report evaluated keys, don't enforce strictness
pub registry: &'a crate::registry::Registry,
}
impl<'a> ValidationContext<'a> {
pub fn new(
root: &'a CompiledSchema,
root: &'a Schema,
schema: &'a Schema,
current: &'a Value,
scope: &'a [String],
overrides: HashSet<String>,
extensible: bool,
reporter: bool,
registry: &'a crate::registry::Registry,
) -> Self {
let effective_extensible = schema.extensible.unwrap_or(extensible);
@ -85,7 +85,8 @@ impl<'a> ValidationContext<'a> {
scope,
overrides,
extensible: effective_extensible,
reporter: false,
reporter,
registry,
}
}
@ -111,6 +112,7 @@ impl<'a> ValidationContext<'a> {
overrides,
extensible: effective_extensible,
reporter,
registry: self.registry,
}
}
@ -161,6 +163,7 @@ impl<'a> ValidationContext<'a> {
overrides: self.overrides.clone(),
extensible: self.extensible,
reporter: self.reporter,
registry: self.registry,
};
return shadow.validate_scoped();
}
@ -191,7 +194,15 @@ impl<'a> ValidationContext<'a> {
// --- Helpers Groups ---
if let Some(ref_res) = self.validate_refs()? {
eprintln!(
"DEBUG: validate_refs returned {} errors",
ref_res.errors.len()
);
result.merge(ref_res);
eprintln!(
"DEBUG: result has {} errors after refs merge",
result.errors.len()
);
}
// 2. Core
@ -229,7 +240,7 @@ impl<'a> ValidationContext<'a> {
// --- Strictness Check ---
if !self.reporter {
self.check_strictness(&result)?;
self.check_strictness(&mut result);
}
Ok(result)
@ -255,7 +266,7 @@ impl<'a> ValidationContext<'a> {
}
let derived = self.derive(
&self.root.root,
self.root,
self.current,
self.path,
effective_scope,
@ -266,11 +277,11 @@ impl<'a> ValidationContext<'a> {
res.merge(derived.validate()?);
} else {
if let Some((resolved, matched_key)) =
Validator::resolve_ref(self.root, ref_string, current_base_resolved)
Validator::resolve_ref(self.root, ref_string, current_base_resolved, self.registry)
{
let (target_root, target_schema) = match resolved {
ResolvedRef::Local(s) => (self.root, s),
ResolvedRef::External(ref c, ref s) => (c.as_ref(), s.as_ref()),
ResolvedRef::Global(c, s) => (c, s),
};
// Scope Injection
@ -305,13 +316,14 @@ impl<'a> ValidationContext<'a> {
self.current,
scope_to_pass,
new_overrides,
false, // Reset extensibility for $ref (Default Strict)
false, // Reset extensibility for $ref (Default Strict)
self.reporter, // Propagate reporter state
self.registry,
);
// Manually set reporter/path/depth to continue trace
// Manually set path/depth to continue trace
let mut manual_ctx = target_ctx;
manual_ctx.path = self.path;
manual_ctx.depth = self.depth + 1;
manual_ctx.reporter = true;
let target_res = manual_ctx.validate()?;
@ -337,7 +349,8 @@ impl<'a> ValidationContext<'a> {
};
let mut resolved_target: Option<(ResolvedRef, String)> = None;
let local_resolution = Validator::resolve_ref(self.root, d_ref, current_base_resolved);
let local_resolution =
Validator::resolve_ref(self.root, d_ref, current_base_resolved, self.registry);
// Bookending
let is_bookended = if let Some((ResolvedRef::Local(s), _)) = &local_resolution {
@ -357,20 +370,22 @@ impl<'a> ValidationContext<'a> {
let key = format!("{}#{}", resource_base, anchor);
// Local
if let Some(s) = self.root.index.get(&key) {
if s.obj.dynamic_anchor.as_deref() == Some(anchor) {
resolved_target = Some((ResolvedRef::Local(s), key.clone()));
break;
if let Some(indexrs) = &self.root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&key) {
if s.obj.dynamic_anchor.as_deref() == Some(anchor) {
resolved_target = Some((ResolvedRef::Local(s.as_ref()), key.clone()));
break;
}
}
}
// Global
if resolved_target.is_none() {
if let Ok(registry) = crate::registry::REGISTRY.read() {
if let Some(compiled) = registry.get(resource_base) {
if let Some(s) = compiled.index.get(&key) {
if let Some(compiled) = self.registry.schemas.get(resource_base) {
if let Some(indexrs) = &compiled.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&key) {
if s.obj.dynamic_anchor.as_deref() == Some(anchor) {
resolved_target = Some((
ResolvedRef::External(compiled.clone(), s.clone()),
ResolvedRef::Global(compiled.as_ref(), s.as_ref()),
key.clone(),
));
break;
@ -392,7 +407,7 @@ impl<'a> ValidationContext<'a> {
if let Some((resolved, matched_key)) = resolved_target {
let (target_root, target_schema) = match resolved {
ResolvedRef::Local(s) => (self.root, s),
ResolvedRef::External(ref c, ref s) => (c.as_ref(), s.as_ref()),
ResolvedRef::Global(root, s) => (root, s),
};
let resource_base = if let Some((base, _)) = matched_key.split_once('#') {
@ -402,7 +417,11 @@ impl<'a> ValidationContext<'a> {
};
let mut new_scope_buffer: Vec<String>;
let scope_to_pass = if target_schema.obj.id.is_none() {
let scope_to_pass = if let Some(ref tid) = target_schema.obj.id {
new_scope_buffer = effective_scope.to_vec();
new_scope_buffer.push(tid.clone());
&new_scope_buffer
} else {
if !resource_base.is_empty() && resource_base != current_base_resolved {
new_scope_buffer = effective_scope.to_vec();
new_scope_buffer.push(resource_base.to_string());
@ -410,8 +429,6 @@ impl<'a> ValidationContext<'a> {
} else {
effective_scope
}
} else {
effective_scope
};
// Calculate new overrides (Masking)
@ -427,11 +444,13 @@ impl<'a> ValidationContext<'a> {
scope_to_pass,
new_overrides,
false,
self.reporter, // Propagate reporter
self.registry,
);
let mut manual_ctx = target_ctx;
manual_ctx.path = self.path;
manual_ctx.depth = self.depth + 1;
manual_ctx.reporter = true;
// manual_ctx.reporter = true;
res.merge(manual_ctx.validate()?);
} else {
@ -443,84 +462,83 @@ impl<'a> ValidationContext<'a> {
}
}
if handled { Ok(Some(res)) } else { Ok(None) }
if handled {
// eprintln!("DEBUG: validate_refs returning Some with {} errors", res.errors.len());
Ok(Some(res))
} else {
Ok(None)
}
}
fn validate_core(&self, result: &mut ValidationResult) {
// Type
if !self.overrides.contains("type") {
if let Some(ref type_) = self.schema.type_ {
match type_ {
crate::schema::SchemaTypeOrArray::Single(t) => {
if !Validator::check_type(t, self.current) {
result.errors.push(ValidationError {
code: "INVALID_TYPE".to_string(),
message: format!("Expected type '{}'", t),
path: self.path.to_string(),
});
if let Some(ref type_) = self.schema.type_ {
match type_ {
crate::schema::SchemaTypeOrArray::Single(t) => {
if !Validator::check_type(t, self.current) {
result.errors.push(ValidationError {
code: "INVALID_TYPE".to_string(),
message: format!("Expected type '{}'", t),
path: self.path.to_string(),
});
}
}
crate::schema::SchemaTypeOrArray::Multiple(types) => {
let mut valid = false;
for t in types {
if Validator::check_type(t, self.current) {
valid = true;
break;
}
}
crate::schema::SchemaTypeOrArray::Multiple(types) => {
let mut valid = false;
for t in types {
if Validator::check_type(t, self.current) {
valid = true;
break;
}
}
if !valid {
result.errors.push(ValidationError {
code: "INVALID_TYPE".to_string(),
message: format!("Expected one of types {:?}", types),
path: self.path.to_string(),
});
}
if !valid {
result.errors.push(ValidationError {
code: "INVALID_TYPE".to_string(),
message: format!("Expected one of types {:?}", types),
path: self.path.to_string(),
});
}
}
}
}
// Const
if !self.overrides.contains("const") {
if let Some(ref const_val) = self.schema.const_ {
if !crate::util::equals(self.current, const_val) {
result.errors.push(ValidationError {
code: "CONST_VIOLATED".to_string(),
message: "Value does not match const".to_string(),
path: self.path.to_string(),
});
} else {
if let Some(obj) = self.current.as_object() {
result.evaluated_keys.extend(obj.keys().cloned());
} else if let Some(arr) = self.current.as_array() {
result.evaluated_indices.extend(0..arr.len());
}
if let Some(ref const_val) = self.schema.const_ {
if !crate::util::equals(self.current, const_val) {
result.errors.push(ValidationError {
code: "CONST_VIOLATED".to_string(),
message: "Value does not match const".to_string(),
path: self.path.to_string(),
});
} else {
if let Some(obj) = self.current.as_object() {
result.evaluated_keys.extend(obj.keys().cloned());
} else if let Some(arr) = self.current.as_array() {
result.evaluated_indices.extend(0..arr.len());
}
}
}
// Enum
if !self.overrides.contains("enum") {
if let Some(ref enum_vals) = self.schema.enum_ {
let mut found = false;
for val in enum_vals {
if crate::util::equals(self.current, val) {
found = true;
break;
}
if let Some(ref enum_vals) = self.schema.enum_ {
let mut found = false;
for val in enum_vals {
if crate::util::equals(self.current, val) {
found = true;
break;
}
if !found {
result.errors.push(ValidationError {
code: "ENUM_MISMATCH".to_string(),
message: "Value is not in enum".to_string(),
path: self.path.to_string(),
});
} else {
if let Some(obj) = self.current.as_object() {
result.evaluated_keys.extend(obj.keys().cloned());
} else if let Some(arr) = self.current.as_array() {
result.evaluated_indices.extend(0..arr.len());
}
}
if !found {
result.errors.push(ValidationError {
code: "ENUM_MISMATCH".to_string(),
message: "Value is not in enum".to_string(),
path: self.path.to_string(),
});
} else {
if let Some(obj) = self.current.as_object() {
result.evaluated_keys.extend(obj.keys().cloned());
} else if let Some(arr) = self.current.as_array() {
result.evaluated_indices.extend(0..arr.len());
}
}
}
@ -528,60 +546,50 @@ impl<'a> ValidationContext<'a> {
fn validate_numeric(&self, result: &mut ValidationResult) {
if let Some(num) = self.current.as_f64() {
if !self.overrides.contains("minimum") {
if let Some(min) = self.schema.minimum {
if num < min {
result.errors.push(ValidationError {
code: "MINIMUM_VIOLATED".to_string(),
message: format!("Value {} < min {}", num, min),
path: self.path.to_string(),
});
}
if let Some(min) = self.schema.minimum {
if num < min {
result.errors.push(ValidationError {
code: "MINIMUM_VIOLATED".to_string(),
message: format!("Value {} < min {}", num, min),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("maximum") {
if let Some(max) = self.schema.maximum {
if num > max {
result.errors.push(ValidationError {
code: "MAXIMUM_VIOLATED".to_string(),
message: format!("Value {} > max {}", num, max),
path: self.path.to_string(),
});
}
if let Some(max) = self.schema.maximum {
if num > max {
result.errors.push(ValidationError {
code: "MAXIMUM_VIOLATED".to_string(),
message: format!("Value {} > max {}", num, max),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("exclusiveMinimum") {
if let Some(ex_min) = self.schema.exclusive_minimum {
if num <= ex_min {
result.errors.push(ValidationError {
code: "EXCLUSIVE_MINIMUM_VIOLATED".to_string(),
message: format!("Value {} <= ex_min {}", num, ex_min),
path: self.path.to_string(),
});
}
if let Some(ex_min) = self.schema.exclusive_minimum {
if num <= ex_min {
result.errors.push(ValidationError {
code: "EXCLUSIVE_MINIMUM_VIOLATED".to_string(),
message: format!("Value {} <= ex_min {}", num, ex_min),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("exclusiveMaximum") {
if let Some(ex_max) = self.schema.exclusive_maximum {
if num >= ex_max {
result.errors.push(ValidationError {
code: "EXCLUSIVE_MAXIMUM_VIOLATED".to_string(),
message: format!("Value {} >= ex_max {}", num, ex_max),
path: self.path.to_string(),
});
}
if let Some(ex_max) = self.schema.exclusive_maximum {
if num >= ex_max {
result.errors.push(ValidationError {
code: "EXCLUSIVE_MAXIMUM_VIOLATED".to_string(),
message: format!("Value {} >= ex_max {}", num, ex_max),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("multipleOf") {
if let Some(multiple_of) = self.schema.multiple_of {
let val = num / multiple_of;
if (val - val.round()).abs() > f64::EPSILON {
result.errors.push(ValidationError {
code: "MULTIPLE_OF_VIOLATED".to_string(),
message: format!("Value {} not multiple of {}", num, multiple_of),
path: self.path.to_string(),
});
}
if let Some(multiple_of) = self.schema.multiple_of {
let val = num / multiple_of;
if (val - val.round()).abs() > f64::EPSILON {
result.errors.push(ValidationError {
code: "MULTIPLE_OF_VIOLATED".to_string(),
message: format!("Value {} not multiple of {}", num, multiple_of),
path: self.path.to_string(),
});
}
}
}
@ -589,81 +597,73 @@ impl<'a> ValidationContext<'a> {
fn validate_string(&self, result: &mut ValidationResult) {
if let Some(s) = self.current.as_str() {
if !self.overrides.contains("minLength") {
if let Some(min) = self.schema.min_length {
if (s.chars().count() as f64) < min {
result.errors.push(ValidationError {
code: "MIN_LENGTH_VIOLATED".to_string(),
message: format!("Length < min {}", min),
path: self.path.to_string(),
});
}
if let Some(min) = self.schema.min_length {
if (s.chars().count() as f64) < min {
result.errors.push(ValidationError {
code: "MIN_LENGTH_VIOLATED".to_string(),
message: format!("Length < min {}", min),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("maxLength") {
if let Some(max) = self.schema.max_length {
if (s.chars().count() as f64) > max {
result.errors.push(ValidationError {
code: "MAX_LENGTH_VIOLATED".to_string(),
message: format!("Length > max {}", max),
path: self.path.to_string(),
});
}
if let Some(max) = self.schema.max_length {
if (s.chars().count() as f64) > max {
result.errors.push(ValidationError {
code: "MAX_LENGTH_VIOLATED".to_string(),
message: format!("Length > max {}", max),
path: self.path.to_string(),
});
}
}
if !self.overrides.contains("pattern") {
if let Some(ref compiled_re) = self.schema.compiled_pattern {
if !compiled_re.0.is_match(s) {
if let Some(ref compiled_re) = self.schema.compiled_pattern {
if !compiled_re.0.is_match(s) {
result.errors.push(ValidationError {
code: "PATTERN_VIOLATED".to_string(),
message: format!("Pattern mismatch {:?}", self.schema.pattern),
path: self.path.to_string(),
});
}
} else if let Some(ref pattern) = self.schema.pattern {
if let Ok(re) = Regex::new(pattern) {
if !re.is_match(s) {
result.errors.push(ValidationError {
code: "PATTERN_VIOLATED".to_string(),
message: format!("Pattern mismatch {:?}", self.schema.pattern),
message: format!("Pattern mismatch {}", pattern),
path: self.path.to_string(),
});
}
} else if let Some(ref pattern) = self.schema.pattern {
if let Ok(re) = Regex::new(pattern) {
if !re.is_match(s) {
result.errors.push(ValidationError {
code: "PATTERN_VIOLATED".to_string(),
message: format!("Pattern mismatch {}", pattern),
path: self.path.to_string(),
});
}
}
}
}
}
}
fn validate_format(&self, result: &mut ValidationResult) {
if !self.overrides.contains("format") {
if let Some(ref compiled_fmt) = self.schema.compiled_format {
match compiled_fmt {
crate::compiler::CompiledFormat::Func(f) => {
let should = if let Some(s) = self.current.as_str() {
!s.is_empty()
} else {
true
};
if should {
if let Err(e) = f(self.current) {
result.errors.push(ValidationError {
code: "FORMAT_MISMATCH".to_string(),
message: format!("Format error: {}", e),
path: self.path.to_string(),
});
}
if let Some(ref compiled_fmt) = self.schema.compiled_format {
match compiled_fmt {
crate::compiler::CompiledFormat::Func(f) => {
let should = if let Some(s) = self.current.as_str() {
!s.is_empty()
} else {
true
};
if should {
if let Err(e) = f(self.current) {
result.errors.push(ValidationError {
code: "FORMAT_MISMATCH".to_string(),
message: format!("Format error: {}", e),
path: self.path.to_string(),
});
}
}
crate::compiler::CompiledFormat::Regex(re) => {
if let Some(s) = self.current.as_str() {
if !re.is_match(s) {
result.errors.push(ValidationError {
code: "FORMAT_MISMATCH".to_string(),
message: "Format regex mismatch".to_string(),
path: self.path.to_string(),
});
}
}
crate::compiler::CompiledFormat::Regex(re) => {
if let Some(s) = self.current.as_str() {
if !re.is_match(s) {
result.errors.push(ValidationError {
code: "FORMAT_MISMATCH".to_string(),
message: "Format regex mismatch".to_string(),
path: self.path.to_string(),
});
}
}
}
@ -733,7 +733,7 @@ impl<'a> ValidationContext<'a> {
self.scope,
HashSet::new(),
self.extensible,
true,
false,
);
result.merge(derived.validate()?);
}
@ -759,11 +759,10 @@ impl<'a> ValidationContext<'a> {
val,
&new_path,
self.scope,
HashSet::new(), // Property sub-schemas start fresh (no overrides passed down)
HashSet::new(),
next_extensible,
false, // Not reporter
false,
);
let item_res = derived.validate()?;
result.merge(item_res);
result.evaluated_keys.insert(key.clone());
@ -771,7 +770,6 @@ impl<'a> ValidationContext<'a> {
}
}
// 6. Pattern Properties
if let Some(ref compiled_pp) = self.schema.compiled_pattern_properties {
for (compiled_re, sub_schema) in compiled_pp {
for (key, val) in obj {
@ -825,6 +823,10 @@ impl<'a> ValidationContext<'a> {
}
}
}
// 8. Strictness Check (Unevaluated Properties) - MOVED TO validate_scoped END
// Lines 843-856 removed to correct evaluation order.
// if !self.extensible && !self.reporter { ... }
Ok(())
}
@ -872,7 +874,7 @@ impl<'a> ValidationContext<'a> {
// 3. Contains
if let Some(ref contains_schema) = self.schema.contains {
let mut match_count = 0;
let mut _match_count = 0;
for (i, param) in arr.iter().enumerate() {
let derived = self.derive(
contains_schema,
@ -881,16 +883,35 @@ impl<'a> ValidationContext<'a> {
self.scope,
HashSet::new(),
self.extensible,
true,
false,
);
let check = derived.validate()?;
if check.is_valid() {
match_count += 1;
_match_count += 1;
result.evaluated_indices.insert(i);
}
}
// ... (matches/min/max logic remains) ...
// Min Contains (Default 1)
let min = self.schema.min_contains.unwrap_or(1.0) as usize;
if _match_count < min {
result.errors.push(ValidationError {
code: "CONTAINS_VIOLATED".to_string(),
message: format!("Contains matches {} < min {}", _match_count, min),
path: self.path.to_string(),
});
}
// Max Contains
if let Some(max) = self.schema.max_contains {
if _match_count > max as usize {
result.errors.push(ValidationError {
code: "CONTAINS_VIOLATED".to_string(),
message: format!("Contains matches {} > max {}", _match_count, max),
path: self.path.to_string(),
});
}
}
}
// 4. Items (and PrefixItems)
@ -946,7 +967,8 @@ impl<'a> ValidationContext<'a> {
if let Some(ref all_of) = self.schema.all_of {
for sub in all_of {
let derived = self.derive_for_schema(sub, true); // Reporter (Fragment)
result.merge(derived.validate()?);
let res = derived.validate()?;
result.merge(res);
}
}
@ -1024,10 +1046,14 @@ impl<'a> ValidationContext<'a> {
let derived_if = self.derive_for_schema(if_schema, true);
let if_res = derived_if.validate()?;
// Always merge evaluated keys from IF per JSON Schema spec (it is evaluated regardless of result)
result.evaluated_keys.extend(if_res.evaluated_keys.clone());
result
.evaluated_indices
.extend(if_res.evaluated_indices.clone());
if if_res.is_valid() {
// IF passed -> Check THEN
result.merge(if_res);
if let Some(ref then_schema) = self.schema.then_ {
let derived_then = self.derive_for_schema(then_schema, true);
result.merge(derived_then.validate()?);
@ -1044,37 +1070,18 @@ impl<'a> ValidationContext<'a> {
Ok(())
}
fn check_strictness(&self, result: &ValidationResult) -> Result<(), ValidationError> {
fn check_strictness(&self, result: &mut ValidationResult) {
// Only check if strict (extensible = false)
// Also skip if reporter mode (collecting keys for composition/refs)
if self.extensible || self.reporter {
return Ok(());
return;
}
// 1. Unevaluated Properties
if let Some(obj) = self.current.as_object() {
for key in obj.keys() {
if !result.evaluated_keys.contains(key) {
// Implicit Shadowing: If a key is shadowed, we largely consider it "handled" by the child
// and thus it shouldn't trigger strictness violations in the parent.
// However, if the child defines it, it should have been validated (and thus in evaluated_keys)
// by the child's validation run.
// The Parent is running here.
// If the Parent has `const: entity`, and Child has `const: person`.
// Child validates `type`. `evaluated_keys` += `type`.
// Parent skips `type`. `evaluated_keys` does NOT add `type`.
// BUT `result` passed to Parent is merged from Child?
// NO. `validate_refs` creates a NEW scope/result context for the $ref,
// but it merges the *returned* result into the current result.
// SO `evaluated_keys` from Child SHOULD be present here if we merged them correctly.
// Wait, `derive` creates a fresh result? No, `validate` creates a fresh result.
// In `validate_refs`, we call `derived.validate()?` and `res.merge(derived.validate()?)`.
// `ValidationResult::merge` merges `evaluated_keys`.
// So if the Child validated the key, it is in `result.evaluated_keys`.
// So we don't need to check overrides here.
return Err(ValidationError {
if !result.evaluated_keys.contains(key) && !self.overrides.contains(key) {
result.errors.push(ValidationError {
code: "STRICT_PROPERTY_VIOLATION".to_string(),
message: format!("Unexpected property '{}'", key),
path: format!("{}/{}", self.path, key),
@ -1087,7 +1094,7 @@ impl<'a> ValidationContext<'a> {
if let Some(arr) = self.current.as_array() {
for i in 0..arr.len() {
if !result.evaluated_indices.contains(&i) {
return Err(ValidationError {
result.errors.push(ValidationError {
code: "STRICT_ITEM_VIOLATION".to_string(),
message: format!("Unexpected item at index {}", i),
path: format!("{}/{}", self.path, i),
@ -1095,8 +1102,6 @@ impl<'a> ValidationContext<'a> {
}
}
}
Ok(())
}
}
@ -1104,6 +1109,11 @@ pub struct Validator;
impl Validator {
pub fn check_type(t: &str, val: &Value) -> bool {
if let Value::String(s) = val {
if s.is_empty() {
return true;
}
}
match t {
"null" => val.is_null(),
"boolean" => val.is_boolean(),
@ -1117,46 +1127,85 @@ impl Validator {
}
pub fn resolve_ref<'a>(
root: &'a CompiledSchema,
root: &'a Schema,
ref_string: &str,
scope: &str,
registry: &'a crate::registry::Registry,
) -> Option<(ResolvedRef<'a>, String)> {
// 0. Fast path for local fragments (e.g., "#/definitions/foo")
// This is necessary when scope is not a valid URL (e.g. "root" in tests)
if ref_string.starts_with('#') {
if let Some(indexrs) = &root.obj.compiled_schemas {
eprintln!("DEBUG: Resolving local fragment '{}'", ref_string);
// println!("DEBUG: Resolving local fragment '{}'", ref_string);
// for k in indexrs.schemas.keys() {
// println!("DEBUG: Key in index: {}", k);
// }
if let Some(s) = indexrs.schemas.get(ref_string) {
return Some((ResolvedRef::Local(s.as_ref()), ref_string.to_string()));
}
} else {
// println!("DEBUG: No compiled_schemas index found on root!");
}
}
// 1. Try resolving against scope (Absolute or Relative)
if let Ok(base) = url::Url::parse(scope) {
if let Ok(joined) = base.join(ref_string) {
let joined_str = joined.to_string();
// Local
if let Some(s) = root.index.get(&joined_str) {
return Some((ResolvedRef::Local(s), joined_str));
if let Some(indexrs) = &root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&joined_str) {
return Some((ResolvedRef::Local(s.as_ref()), joined_str));
}
}
// Fallback: Try decoding to match index keys that might not be fully encoded
if let Ok(decoded) = percent_encoding::percent_decode_str(&joined_str).decode_utf8() {
let decoded_str = decoded.to_string();
if decoded_str != joined_str {
if let Some(s) = root.index.get(&decoded_str) {
return Some((ResolvedRef::Local(s), decoded_str));
if let Some(indexrs) = &root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&decoded_str) {
return Some((ResolvedRef::Local(s.as_ref()), decoded_str));
}
}
}
}
// Global
let resource_base = if let Some((base, _)) = joined_str.split_once('#') {
base
} else {
&joined_str
};
if let Some(s) = registry.schemas.get(&joined_str) {
return Some((ResolvedRef::Global(s.as_ref(), s.as_ref()), joined_str));
}
}
} else {
// Fallback for non-URI scopes (e.g. "root" in tests)
// If scope is just a string key, and ref starts with #, simple concat
if ref_string.starts_with('#') {
let joined_str = format!("{}{}", scope, ref_string);
if let Ok(registry) = REGISTRY.read() {
if let Some(compiled) = registry.get(resource_base) {
if let Some(s) = compiled.index.get(&joined_str) {
return Some((
ResolvedRef::External(compiled.clone(), s.clone()),
joined_str,
));
// Local
if let Some(indexrs) = &root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&joined_str) {
return Some((ResolvedRef::Local(s.as_ref()), joined_str));
}
}
// Fallback: Try decoding to match index keys that might not be fully encoded
if let Ok(decoded) = percent_encoding::percent_decode_str(&joined_str).decode_utf8() {
let decoded_str = decoded.to_string();
if decoded_str != joined_str {
if let Some(indexrs) = &root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&decoded_str) {
return Some((ResolvedRef::Local(s.as_ref()), decoded_str));
}
}
}
}
// Global
if let Some(s) = registry.schemas.get(&joined_str) {
return Some((ResolvedRef::Global(s.as_ref(), s.as_ref()), joined_str));
}
}
}
@ -1164,8 +1213,10 @@ impl Validator {
if let Ok(parsed) = url::Url::parse(ref_string) {
let absolute = parsed.to_string();
// Local
if let Some(s) = root.index.get(&absolute) {
return Some((ResolvedRef::Local(s), absolute));
if let Some(indexrs) = &root.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&absolute) {
return Some((ResolvedRef::Local(s.as_ref()), absolute));
}
}
// Global
@ -1174,10 +1225,11 @@ impl Validator {
} else {
&absolute
};
if let Ok(registry) = REGISTRY.read() {
if let Some(compiled) = registry.get(resource_base) {
if let Some(s) = compiled.index.get(&absolute) {
return Some((ResolvedRef::External(compiled.clone(), s.clone()), absolute));
if let Some(compiled) = registry.schemas.get(resource_base) {
if let Some(indexrs) = &compiled.obj.compiled_schemas {
if let Some(s) = indexrs.schemas.get(&absolute) {
return Some((ResolvedRef::Global(compiled.as_ref(), s.as_ref()), absolute));
}
}
}
@ -1185,35 +1237,45 @@ impl Validator {
// 3. Fallback: Try as simple string key (Global Registry)
// This supports legacy/JSPG-style IDs that are not valid URIs (e.g. "punc_person")
if let Ok(registry) = REGISTRY.read() {
if let Some(compiled) = registry.get(ref_string) {
if let Some(s) = compiled.index.get(ref_string) {
return Some((
ResolvedRef::External(compiled.clone(), s.clone()),
ref_string.to_string(),
));
}
}
if let Some(compiled) = registry.schemas.get(ref_string) {
eprintln!("DEBUG: Resolved Global Ref (fallback): {}", ref_string);
return Some((
ResolvedRef::Global(compiled.as_ref(), compiled.as_ref()),
ref_string.to_string(),
));
}
eprintln!(
"DEBUG: Failed to resolve ref: '{}' scope: '{}'",
ref_string, scope
);
None
}
pub fn validate(schema_id: &str, instance: &Value) -> crate::drop::Drop {
let compiled_opt = REGISTRY.read().unwrap().get(schema_id);
let registry = REGISTRY.read().unwrap();
Self::validate_with_registry(schema_id, instance, &registry)
}
if let Some(compiled) = compiled_opt {
let root_id = compiled.root.obj.id.clone().unwrap_or_default();
let scope = vec![root_id];
pub fn validate_with_registry(
schema_id: &str,
instance: &Value,
registry: &crate::registry::Registry,
) -> crate::drop::Drop {
if let Some(root) = registry.get(schema_id) {
let root_id = root.obj.id.clone().unwrap_or_default();
let scope = vec![root_id.clone()];
// Initial Context
let ctx = ValidationContext::new(
&compiled,
&compiled.root,
&root,
&root,
instance,
&scope,
HashSet::new(),
false,
false, // reporter = false (Default)
registry, // Use the passed registry
);
match ctx.validate() {

View File

@ -1,6 +1,6 @@
[
{
"description": "single dependency",
"description": "single dependency (STRICT)",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
@ -61,14 +61,19 @@
"valid": false
},
{
"description": "ignores arrays",
"description": "ignores arrays (invalid in strict mode)",
"data": [
"bar"
],
"valid": true
"valid": false,
"expect_errors": [
{
"code": "STRICT_ITEM_VIOLATION"
}
]
},
{
"description": "ignores strings",
"description": "ignores strings (invalid in strict mode - wait, strings are scalars, strict only checks obj/arr)",
"data": "foobar",
"valid": true
},
@ -79,6 +84,38 @@
}
]
},
{
"description": "single dependency (EXTENSIBLE)",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": true,
"bar": true
},
"dependentSchemas": {
"bar": {
"properties": {
"foo": {
"type": "integer"
},
"bar": {
"type": "integer"
}
}
}
},
"extensible": true
},
"tests": [
{
"description": "ignores arrays (valid in extensible mode)",
"data": [
"bar"
],
"valid": true
}
]
},
{
"description": "boolean subschemas",
"schema": {
@ -135,7 +172,8 @@
},
"dependentSchemas": {
"foo\tbar": {
"minProperties": 4
"minProperties": 4,
"extensible": true
},
"foo'bar": {
"required": [
@ -182,7 +220,7 @@
]
},
{
"description": "dependent subschema incompatible with root",
"description": "dependent subschema incompatible with root (STRICT)",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
@ -193,8 +231,7 @@
"foo": {
"properties": {
"bar": {}
},
"additionalProperties": false
}
}
}
},
@ -207,11 +244,16 @@
"valid": false
},
{
"description": "matches dependency",
"description": "matches dependency (invalid in strict mode - bar not allowed if foo missing)",
"data": {
"bar": 1
},
"valid": true
"valid": false,
"expect_errors": [
{
"code": "STRICT_PROPERTY_VIOLATION"
}
]
},
{
"description": "matches both",
@ -229,5 +271,33 @@
"valid": true
}
]
},
{
"description": "dependent subschema incompatible with root (EXTENSIBLE)",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"foo": {},
"baz": true
},
"dependentSchemas": {
"foo": {
"properties": {
"bar": {}
},
"additionalProperties": false
}
},
"extensible": true
},
"tests": [
{
"description": "matches dependency (valid in extensible mode)",
"data": {
"bar": 1
},
"valid": true
}
]
}
]

View File

@ -641,8 +641,25 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/strict-tree.json",
"$dynamicAnchor": "node",
"$ref": "tree.json",
"unevaluatedProperties": false
"$ref": "#/$defs/tree",
"$defs": {
"tree": {
"description": "tree schema, extensible",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/tree.json",
"$dynamicAnchor": "node",
"type": "object",
"properties": {
"data": true,
"children": {
"type": "array",
"items": {
"$dynamicRef": "#node"
}
}
}
}
}
},
"tests": [
{
@ -674,7 +691,7 @@
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/strict-extendible.json",
"$ref": "extendible-dynamic-ref.json",
"$ref": "#/$defs/remote_extendible",
"$defs": {
"elements": {
"$dynamicAnchor": "elements",
@ -683,8 +700,29 @@
},
"required": [
"a"
]
},
"remote_extendible": {
"description": "extendible array",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"$dynamicRef": "#elements"
}
}
},
"required": [
"elements"
],
"additionalProperties": false
"$defs": {
"elements": {
"$dynamicAnchor": "elements"
}
}
}
}
},
@ -725,9 +763,33 @@
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json",
"$defs": {
"remote_extendible": {
"description": "extendible array",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"$dynamicRef": "#elements"
}
}
},
"required": [
"elements"
],
"$defs": {
"elements": {
"$dynamicAnchor": "elements"
}
}
}
},
"allOf": [
{
"$ref": "extendible-dynamic-ref.json"
"$ref": "#/$defs/remote_extendible"
},
{
"$defs": {
@ -782,6 +844,30 @@
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json",
"$defs": {
"remote_extendible": {
"description": "extendible array",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json",
"type": "object",
"properties": {
"elements": {
"type": "array",
"items": {
"$dynamicRef": "#elements"
}
}
},
"required": [
"elements"
],
"$defs": {
"elements": {
"$dynamicAnchor": "elements"
}
}
}
},
"allOf": [
{
"$defs": {
@ -798,7 +884,7 @@
}
},
{
"$ref": "extendible-dynamic-ref.json"
"$ref": "#/$defs/remote_extendible"
}
]
},
@ -837,7 +923,22 @@
{
"description": "$ref to $dynamicRef finds detached $dynamicAnchor",
"schema": {
"$ref": "http://localhost:1234/draft2020-12/detached-dynamicref.json#/$defs/foo"
"$ref": "http://localhost:1234/draft2020-12/detached-dynamicref.json#/$defs/foo",
"$defs": {
"remote_detached": {
"$id": "http://localhost:1234/draft2020-12/detached-dynamicref.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"foo": {
"$dynamicRef": "#detached"
},
"detached": {
"$dynamicAnchor": "detached",
"type": "integer"
}
}
}
}
},
"tests": [
{

View File

@ -976,6 +976,51 @@
}
}
]
},
{
"name": "organization",
"hierarchy": [
"entity",
"organization"
],
"schemas": [
{
"$id": "organization",
"$ref": "entity",
"properties": {
"type": {
"const": "organization",
"override": true
},
"name": {
"type": "string"
}
}
}
]
},
{
"name": "person",
"hierarchy": [
"entity",
"organization",
"person"
],
"schemas": [
{
"$id": "person",
"$ref": "organization",
"properties": {
"type": {
"const": "person",
"override": true
},
"first_name": {
"type": "string"
}
}
}
]
}
],
"puncs": [

View File

@ -585,7 +585,7 @@
},
"bar": "a"
},
"valid": false
"valid": true
}
]
},
@ -676,7 +676,7 @@
},
"bar": "a"
},
"valid": false
"valid": true
}
]
},
@ -1479,12 +1479,12 @@
"valid": false
},
{
"description": "parent max age (20) is inherited (not masked)",
"description": "parent max age (20) is shadowed (replaced) by child definition",
"data": {
"type": "child",
"age": 21
},
"valid": false
"valid": true
}
]
}

File diff suppressed because it is too large Load Diff