Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/librecat/catmandu-validator-jsonschema
Catmandu Validator for JSON Schema
https://github.com/librecat/catmandu-validator-jsonschema
Last synced: 4 days ago
JSON representation
Catmandu Validator for JSON Schema
- Host: GitHub
- URL: https://github.com/librecat/catmandu-validator-jsonschema
- Owner: LibreCat
- License: other
- Created: 2014-05-11T17:32:12.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T06:52:47.000Z (over 4 years ago)
- Last Synced: 2024-05-09T11:36:26.048Z (6 months ago)
- Language: Perl
- Homepage: https://metacpan.org/pod/Catmandu::Validator::JSONSchema
- Size: 26.4 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Catmandu::Validator::JSONSchema - An implementation of Catmandu::Validator to support JSON Schema
# STATUS
[![Build Status](https://travis-ci.org/LibreCat/Catmandu-Validator-JSONSchema.svg?branch=master)](https://travis-ci.org/LibreCat/Catmandu-Validator-JSONSchema)
[![Coverage](https://coveralls.io/repos/LibreCat/Catmandu-Validator-JSONSchema/badge.svg?branch=master)](https://coveralls.io/r/LibreCat/Catmandu-Validator-JSONSchema)
[![CPANTS kwalitee](http://cpants.cpanauthors.org/dist/Catmandu-Validator-JSONSchema.png)](http://cpants.cpanauthors.org/dist/Catmandu-Validator-JSONSchema)# SYNOPSIS
use Catmandu::Validator::JSONSchema;
use Data::Dumper;my $validator = Catmandu::Validator::JSONSchema->new(
schema => {
"properties"=> {
"_id"=> {
"type"=> "string",
required => 1
},
"title"=> {
"type"=> "string",
required => 1
},
"author"=> {
"type"=> "array",
"items" => {
"type" => "string"
},
minItems => 1,
uniqueItems => 1
}
},
}
);my $object = {
_id => "rug01:001963301",
title => "In gesprek met Etienne Vermeersch : een zoektocht naar waarheid",
author => [
"Etienne Vermeersch",
"Dirk Verhofstadt"
]
};unless($validator->validate($object)){
print Dumper($validator->last_errors());
}# CONFIGURATION
- schema
JSON Schema given as hash reference, filename, or URL.
# NOTE
This module uses [JSON::Validator](https://metacpan.org/pod/JSON::Validator). Therefore the behaviour of your schema
should apply to draft 0i4 of the json schema:[http://json-schema.org/draft-04/schema](http://json-schema.org/draft-04/schema)
[http://tools.ietf.org/html/draft-zyp-json-schema-04](http://tools.ietf.org/html/draft-zyp-json-schema-04)
# SEE ALSO
[Catmandu::Validator](https://metacpan.org/pod/Catmandu::Validator)
[http://json-schema.org](http://json-schema.org)
# AUTHOR
Nicolas Franck, ``
# LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.See http://dev.perl.org/licenses/ for more information.