OptimumCode/json-schema-validator

Each assertion should be loaded independently instead of grouping in one factory

OptimumCode opened this issue · 0 comments

Currently, assertions for properties (properties, patternProperties, additionalProperties), arrays (items, additonalItems) and condition (if, then, else) are loaded by a single factory (for each group).
Because of that the factory must load all of them and conditionally create an assertion that choose which of those "sub-assertions" to use.
This makes its implementation less obvious (because each assertion must able to be referenced).

The idea is to split each assertion in its own factory and create a group assertion that will execute them in the required order (because the order does matter in this case)