Closed brennj closed 1 year ago
Implements support for advanced validation logic and computed values in JSON Schema Forms based on RFC #39.
The main changes are:
Adds a new x-jsf-logic extension that can contain:
x-jsf-logic
validations
computedValues
if/then/else
createValidationChecker utility parses schema and extracts rules into a map for efficient validation
createValidationChecker
Properties can define x-jsf-requiredValidations to link required custom validations
x-jsf-requiredValidations
Computed values can be used in attributes like title, description, minimum etc via x-jsf-computedAttributes
title
description
minimum
x-jsf-computedAttributes
yupSchemaWithCustomJSONLogic integrates custom validations into Yup schemas
yupSchemaWithCustomJSONLogic
Supports referencing nested fields in objects and arrays
Inline rules can be defined directly in computed attributes
Extensive test cases added covering wide range of examples
This enables much more advanced dynamic behaviour in forms based on values of other fields. Helps unify validation logic between client and server.
See the RFC internally for full details and other Remote specific examples. Main benefits are:
Closing in favour of the slew of other PRs that make it more.. digestible :D
Implements support for advanced validation logic and computed values in JSON Schema Forms based on RFC #39.
The main changes are:
Adds a new
x-jsf-logic
extension that can contain:validations
- Custom validation rules defined in JsonLogic formatcomputedValues
- Values computed dynamically from other fieldsif/then/else
conditional logiccreateValidationChecker
utility parses schema and extracts rules into a map for efficient validationProperties can define
x-jsf-requiredValidations
to link required custom validationsComputed values can be used in attributes like
title
,description
,minimum
etc viax-jsf-computedAttributes
yupSchemaWithCustomJSONLogic
integrates custom validations into Yup schemasSupports referencing nested fields in objects and arrays
Inline rules can be defined directly in computed attributes
Extensive test cases added covering wide range of examples
This enables much more advanced dynamic behaviour in forms based on values of other fields. Helps unify validation logic between client and server.
See the RFC internally for full details and other Remote specific examples. Main benefits are: