Skip to content

Commit 9606396

Browse files
committed
more features
1 parent 65da474 commit 9606396

File tree

10 files changed

+1542
-113
lines changed

10 files changed

+1542
-113
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var result = schema.validate(
104104
// result.valid() => true
105105
```
106106

107-
Compatibility: runs the official 2020‑12 JSON Schema Test Suite on `verify`; **measured compatibility is 63.3%** (1,153 of 1,822 tests pass) with comprehensive metrics reporting.
107+
Compatibility: runs the official 2020‑12 JSON Schema Test Suite on `verify`; **measured compatibility is 64.6%** (1,177 of 1,822 tests pass) with comprehensive metrics reporting.
108108

109109
### JSON Schema Test Suite Metrics
110110

@@ -122,9 +122,9 @@ mvn verify -pl json-java21-schema -Djson.schema.metrics=csv
122122
```
123123

124124
**Current measured compatibility**:
125-
- **Overall**: 63.3% (1,153 of 1,822 tests pass)
125+
- **Overall**: 64.6% (1,177 of 1,822 tests pass)
126126
- **Test coverage**: 420 test groups, 1,657 validation attempts
127-
- **Skip breakdown**: 70 unsupported schema groups, 2 test exceptions, 504 lenient mismatches
127+
- **Skip breakdown**: 70 unsupported schema groups, 2 test exceptions, 480 lenient mismatches
128128

129129
## Building
130130

json-java21-schema/AGENTS.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ mvnd verify -pl json-java21-schema -Djson.schema.metrics=json
6464
mvnd verify -pl json-java21-schema -Djson.schema.metrics=csv
6565
```
6666

67-
**Current measured compatibility** (as of implementation):
68-
- **Overall**: 63.3% (1,153 of 1,822 tests pass)
69-
- **Test coverage**: 420 test groups, 1,657 validation attempts
70-
- **Skip breakdown**: 70 unsupported schema groups, 2 test exceptions, 504 lenient mismatches
67+
**Current measured compatibility** (as of Pack 2 - Arrays core implementation):
68+
- **Overall**: 65.9% (1,200 of 1,822 tests pass)
69+
- **Test coverage**: 420 test groups, 1,649 validation attempts
70+
- **Skip breakdown**: 72 unsupported schema groups, 2 test exceptions, 449 lenient mismatches
71+
72+
**Improvement from Pack 1**: +1.3% (from 64.6% to 65.9%)
7173

7274
The metrics distinguish between:
7375
- **unsupportedSchemaGroup**: Whole groups skipped due to unsupported features (e.g., $ref, anchors)
@@ -84,6 +86,12 @@ The metrics distinguish between:
8486
- **Custom constraints**: Business rule validation
8587
- **Error reporting**: Detailed validation messages
8688

89+
#### Array Keywords Tests (`JsonSchemaArrayKeywordsTest.java`) - Pack 2
90+
- **Contains validation**: `contains` with `minContains`/`maxContains` constraints
91+
- **Unique items**: Structural equality using canonicalization for objects/arrays
92+
- **Prefix items**: Tuple validation with `prefixItems` + trailing `items` validation
93+
- **Combined features**: Complex schemas using all array constraints together
94+
8795
### Development Workflow
8896

8997
1. **TDD Approach**: All tests must pass before claiming completion
@@ -98,6 +106,8 @@ The metrics distinguish between:
98106
- **Conditional validation**: if/then/else supported via `ConditionalSchema`
99107
- **Composition**: allOf, anyOf, not patterns implemented
100108
- **Error paths**: JSON Pointer style paths in validation errors
109+
- **Array validation**: Draft 2020-12 array features (contains, uniqueItems, prefixItems)
110+
- **Structural equality**: Canonical JSON serialization for uniqueItems validation
101111

102112
### Testing Best Practices
103113

json-java21-schema/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Compatibility and verify
2323
- The module runs the official JSON Schema Test Suite during Maven verify.
2424
- Default mode is lenient: unsupported groups/tests are skipped to avoid build breaks while still logging.
2525
- Strict mode: enable with -Djson.schema.strict=true to enforce full assertions.
26-
- **Measured compatibility**: 63.3% (1,153 of 1,822 tests pass in lenient mode)
27-
- **Test coverage**: 420 test groups, 1,657 validation attempts, 70 unsupported schema groups, 2 test exceptions
26+
- **Measured compatibility**: 64.6% (1,177 of 1,822 tests pass in lenient mode)
27+
- **Test coverage**: 420 test groups, 1,657 validation attempts, 70 unsupported schema groups, 2 test exceptions, 480 lenient mismatches
2828
- Detailed metrics available via `-Djson.schema.metrics=json|csv`
2929

3030
How to run

0 commit comments

Comments
 (0)