In @hyperjump/json-schema, you can compile a schema once and use that compiled schema to validate against many instances much more efficiently. The compile step is asynchronous and the interpret step is not. I'd like to make returning the result from getErrors an output option for the interpret step, but I can't because getErrors is asynchronous. That's why I added the validate function here (#203) for now where the interpret step can have a different API.
I want to find a way to make the getErrors function synchronous so it can be used in @hyperjump/json-schema.
The asynchronous part is getting values from the schema. Those values should all be in the compiled schema AST. So, it should be possible to build something to get values synchronously from the AST instead of getSchema/Schema.value.
In
@hyperjump/json-schema, you can compile a schema once and use that compiled schema to validate against many instances much more efficiently. The compile step is asynchronous and the interpret step is not. I'd like to make returning the result fromgetErrorsan output option for the interpret step, but I can't becausegetErrorsis asynchronous. That's why I added thevalidatefunction here (#203) for now where the interpret step can have a different API.I want to find a way to make the
getErrorsfunction synchronous so it can be used in@hyperjump/json-schema.The asynchronous part is getting values from the schema. Those values should all be in the compiled schema AST. So, it should be possible to build something to get values synchronously from the AST instead of
getSchema/Schema.value.