File: Some.pm

package info (click to toggle)
libjson-validator-perl 4.14%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 828 kB
  • sloc: perl: 2,816; makefile: 14
file content (17 lines) | stat: -rw-r--r-- 410 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package Some;
use Mojo::Base -base;

sub j             { JSON::Validator->new }
sub validate_age0 { shift->j->schema('data:///age0.json')->validate(shift) }
sub validate_age1 { shift->j->schema('data:///age1.json')->validate(shift) }

1;
__DATA__
@@ age0.json
{
  "title": "Some module",
  "type": "object",
  "properties": {
    "age": { "type": "integer", "minimum": 0, "description": "Age in years" }
  }
}