Skip to content

Get schema values synchronously from the AST #204

@jdesrosiers

Description

@jdesrosiers

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions