NAME
JSON::Structure::SchemaValidator - Validate JSON Structure schema documents
SYNOPSIS
use JSON::Structure::SchemaValidator;
use JSON::PP;
my $validator = JSON::Structure::SchemaValidator->new(
extended => 1, # Enable extended validation
allow_import => 1, # Enable $import/$importdefs
);
my $schema = decode_json($schema_json);
my $result = $validator->validate($schema, $schema_json);
if ($result->is_valid) {
say "Schema is valid!";
} else {
for my $error (@{$result->errors}) {
say $error->to_string;
}
}
DESCRIPTION
Validates JSON Structure Core documents for conformance with the specification. Provides error messages annotated with line and column numbers.
validate($doc, $source_text)
Validates a JSON Structure schema document.
Returns a ValidationResult object with errors and warnings.
AUTHOR
JSON Structure Project
LICENSE
MIT License