-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Summary
Implement a JSON Type Definition (JTD) validator based on RFC 8927 in the new submodule.
What is JTD?
JSON Type Definition (JTD) is a schema language for JSON designed for:
- Code generation from schemas
- Portable validation with standardized error indicators
- Simpler alternative to JSON Schema with eight mutually-exclusive forms
Implementation Requirements
Based on RFC 8927, the implementation needs to support:
Eight JTD Forms
- empty - Validates any JSON value
- ref - References a definition in the schema
- type - Validates primitive types (boolean, float32/64, int/uint 8/16/32, string, timestamp)
- enum - Validates against a set of string values
- elements - Validates homogeneous arrays
- properties - Validates objects with required/optional fields
- values - Validates objects with homogeneous values
- discriminator - Validates tagged unions
Key Features
- Support for definitions (schema reuse)
- Standardized error reporting with and
- No 64-bit integers (as per RFC)
- No nested definitions
- RFC 8259 JSON compliance
Implementation Plan
- Core Types - Create sealed interfaces/records for JTD schema representation
- Parser - Parse JSON into JTD schema objects
- Validator - Implement validation logic for all eight forms
- Error Reporting - Implement standardized error format
- Tests - Comprehensive test coverage including RFC examples
Test Requirements
- Unit tests for each JTD form
- Integration tests with RFC example schemas
- Error case testing
- Performance benchmarks
References
Acceptance Criteria
- All eight JTD forms implemented and tested
- Standardized error reporting working
- RFC example schemas pass validation
- Performance acceptable for typical use cases
- Documentation following JEP 467 format
- Integration with existing json-java21 project structure
Metadata
Metadata
Assignees
Labels
No labels