OptimumCode / json-schema-validator

The JSON schema validation library that works with https://github.com/Kotlin/kotlinx.serialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

OptimumCode opened this issue · 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)