Move validate to a JSE output format for @hyperjump/json-schema - #284
Merged
Merged
Conversation
Importing this package now registers a JSE output format with @hyperjump/json-schema's setOutputFormat, so validation can return error messages directly. This replaces validate and evaluateCompiledSchema. The output plugin stays in this package. JSE's output type and the locale option are added to @hyperjump/json-schema's types by augmenting OutputFormats and ValidationOptions. Whether a keyword is a simple applicator now comes from its @hyperjump/json-schema keyword definition instead of being duplicated on normalization handlers. 'then', 'else', and 'dependentSchemas' are simple applicators there, so their results are merged into their parent schema. Their normalization handlers are marked as conditional so their merged results aren't described as requirements of the parent, since their handlers describe them along with the condition. Applicators keep their subschemas' outputs so they can be described. This replaces validityFromSubschemas. This requires @hyperjump/json-schema 1.18.0, which adds setOutputFormat and no longer treats 'if' as a simple applicator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing this package now registers a JSE output format with
@hyperjump/json-schema'ssetOutputFormat, so validation can return error messages directly. This replacesvalidateandevaluateCompiledSchema.JSE's output type and the locale option are added to@hyperjump/json-schema's types by augmentingOutputFormatsandValidationOptions.Whether a keyword is a simple applicator now comes from its
@hyperjump/json-schemakeyword definition instead of being duplicated on normalization handlers.then,else, anddependentSchemasare simple applicators there, so their results are merged into their parentschema. Their normalization handlers are marked as conditional so their merged results aren't described as requirements of the parent, since their handlers describe them along with the condition. Applicators keep their subschemas' outputs so they can be described. This replaces
validityFromSubschemas.This requires
@hyperjump/json-schema1.18.0, which addssetOutputFormatand no longer treats
ifas a simple applicator.