This PR contains major changes. It replaces the existing base Schema type with a new version that takes JSONValue to create the underlying schema structure. This means removing the previous initializers for schemas. Going forward, builders will be the best way to generate the Schema's directly.
This change enables support for more keywords and creates a more modular architecture. Each keyword is not defined by a separate struct, that also handles its own validation logic.
With the underlying changes, many of the builder APIs have changed.
See README and DocC with more information on changes.
Future work
Change output of parse method to throws(ParseIssue) -> Output, dropping Validated<Output, String>
[Meta] validate the ValidationResult and add tests
Hook-up the absoluteSchemaLocation in the annotations and results
Support older drafts?
Integration tests for builders, parsing, and validation
Complete Validation
Finish dynamicRef
Fix URN support
Add $vocabulary support
Improve ValidationIssue with associated values
Fix Swift 6 Context Sendable issues
Adds tests for Schema usage with Codable
Merge JSONPointer location with URL?
Fix schemaValue for boolean schemas
Better format keyword support
Add more modifiers for all keywords to builders ($id, $schema, $comment, etc)
Meta schema validation convenience methods
Type of Change
[ ] Bug fix
[x] New feature
[x] Breaking change
[x] Documentation update
Additional Notes
Add any other context or screenshots about the pull request here.
Note: You can add the auto-format label to this pull request to enable automatic Swift formatting.
Description
This PR contains major changes. It replaces the existing base
Schema
type with a new version that takesJSONValue
to create the underlying schema structure. This means removing the previous initializers for schemas. Going forward, builders will be the best way to generate the Schema's directly.This change enables support for more keywords and creates a more modular architecture. Each keyword is not defined by a separate struct, that also handles its own validation logic.
With the underlying changes, many of the builder APIs have changed.
See README and DocC with more information on changes.
Future work
parse
method tothrows(ParseIssue) -> Output
, droppingValidated<Output, String>
ValidationResult
and add testsabsoluteSchemaLocation
in the annotations and resultsdynamicRef
$vocabulary
supportValidationIssue
with associated valuesContext
Sendable issuesSchema
usage withCodable
schemaValue
for boolean schemasformat
keyword support$id
,$schema
,$comment
, etc)Type of Change
Additional Notes
Add any other context or screenshots about the pull request here.
Note: You can add the
auto-format
label to this pull request to enable automatic Swift formatting.