NAME

JSON::Schema::Fast::Compiled - a compiled JSON Schema validator object

DESCRIPTION

Returned by JSON::Schema::Fast->compile. Holds the arena IR for one schema and validates Perl data against it. All behaviour lives in XS; see JSON::Schema::Fast for compiling and the option list.

METHODS

is_valid

my $bool = $v->is_valid($data);

A fast boolean: true if $data is valid. Short-circuits on the first failure and allocates nothing on the valid path.

validate

my $bool           = $v->validate($data);   # scalar context
my ($ok, $errors)  = $v->validate($data);   # list context: (1) or (0, \@errors)

In list context returns (1) when valid, or (0, \@errors) when not. In scalar context returns the boolean.

errors

my $errors = $v->errors($data);   # arrayref, empty when valid

Each error is a hashref with instanceLocation and schemaLocation (RFC 6901 JSON Pointers), the failing keyword, and a message. See "ERRORS" in JSON::Schema::Fast.

engine

Returns 'interp' (the interpreter engine).

schema

Returns the (normalised) schema this object was compiled from.

AUTHOR

LNATION <email@lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION. This is free software, licensed under the Artistic License 2.0 (GPL Compatible).