Please enable JavaScript.
Coggle requires JavaScript to display documents.
Change error when there is unrelated dimension in model - Coggle Diagram
Change error when there is unrelated dimension in model
Route 1
Description
Matts PR
Focused on making the "to" and "from" properties of the dimension relationship optional.
Eli's PR after the above
Focused on attempting to reduce errors using a reducer prior to reporting the errors. Effectively collapsing multiple into one.
Pros/Cons
Cons
it requires passing ObjectType to the SchemaValidatorWrapper and involving extra logic to conditionally reduce errors that have already been compared
Involves comparisons and reporting of ALL errors
May not always want to merge errors
Pros
Can be a simple solution
Can be used as a "map" to give custom reducer functions to any given validation output.
Route 2
Description
Focuses on editing the model schema to add a single "validateProperty" to any given property to register a user-defined keyword.
These user-defined keywords can have JS logic attached at the
validation
compilation
macro
code
Levels.
This offers flexibility in defining keywords to register for any given schema validator:
i.e. YamlModelSchemaValidator
Pros/cons
Pros
Involves documented approaches to introducing complex validation logic for JSON Schemas
Can reduce comparisons by modifying behavior given n-errors.
i.e. if we have 3 errors, and only need to report 2, we can stop reporting if there is "potential" for more.
defines a standard to implement future custom/complex validations
cons
would require definition of good comparators to reduce overhead and not introduce complexity/validation time
If they were inefficient: it could slow down the comparison process.
If they were efficient: They could speed up the comparison process
analysis
Map of how we use these validators and where we can put Validation
AJV DOCUMENTATION
https://ajv.js.org/guide/user-keywords.html
https://ajv.js.org/keywords.html