View on
MetaCPAN
Yanick Champoux > JSON-Schema-AsType-0.4.3 > JSON::Schema::AsType::Draft6::Types

Download:
JSON-Schema-AsType-0.4.3.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v0.4.3   Source  

NAME ^

JSON::Schema::AsType::Draft6::Types - JSON-schema v6 keywords as types

VERSION ^

version 0.4.3

SYNOPSIS ^

    use JSON::Schema::AsType::Draft6::Types '-all';

    my $type = Object & 
        Properties[
            foo => Minimum[3]
        ];

    $type->check({ foo => 5 });  # => 1
    $type->check({ foo => 1 });  # => 0

EXPORTED TYPES ^

        Null Boolean Array Object String Integer Pattern Number Enum

        OneOf AllOf AnyOf 

        Not

        Minimum ExclusiveMinimum Maximum ExclusiveMaximum MultipleOf

        MaxLength MinLength

        Items AdditionalItems MaxItems MinItems UniqueItems

        PatternProperties AdditionalProperties MaxProperties MinProperties

        Dependencies Dependency

Schema

Only verifies that the variable is a Type::Tiny.

Can coerce the value from a hashref defining the schema.

    my $schema = Schema->coerce( \%schema );

    # equivalent to

    $schema = JSON::Schema::AsType::Draft4->new(
        draft_version => 6,
        schema => \%schema;
    )->type;

AUTHOR ^

Yanick Champoux <yanick@babyl.dyndns.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2017, 2015 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: