• Given a subject object and a JSON schema contract, validate the subject against the contract.

    Errors are returned in a zod-like format, and processed to better handle unions.

    Parameters

    • subject: object

      The object to validate.

    • schema: SchemaObject

      The JSON schema to validate against.

    Returns ParseConfigurationResult<unknown> & {
        rawErrors?: AjvError[];
    }

    The result of the validation. If the state is 'error', the errors will be in a zod-like format.