NAME
JSV::Validator - A perl implementation of JSON Schema validator
SYNOPSIS
use feature qw(say);
use JSV::Validator;
JSV::Validator->load_environments("draft4");
my $v = JSV::Validator->new(
environment => "draft4"
);
my $schema = {
type => "object",
properties => {
foo => { type => "integer" },
bar => { type => "string" }
},
required => [ "foo" ]
};
say $v->validate($schema, {}); # invalid
say $v->validate($schema, { foo => 1 }); # valid
say $v->validate($schema, { foo => 10, bar => "xyz" }); # valid
say $v->validate($schema, { foo => 1.2, bar => "xyz" }); # invalid
DESCRIPTION
METHODS
SEE ALSO
- http://json-schema.org/
- B
- Class::Accessor::Lite
- Data::Clone
- Exporter
- JSON
- JSON::Pointer
- List::Util
- List::MoreUtils
- Module::Pluggable::Object
- Scalar::Util
- URI
- URI::Split
LICENSE
Copyright (C) Toru Yamaguchi
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Toru Yamaguchi <zigorou@cpan.org>