Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
t Oops. 0 is a valid integer!
xt
.gitignore
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile

README.md

NAME

ThaiSchema - Lightweight schema validator

SYNOPSIS

use ThaiSchema;

match_schema({x => 3}, {x => type_int});

DESCRIPTION

ThaiSchema is a lightweight schema validator.

FUNCTIONS

  • type_int()

    Is it a int value?

  • type_str()

    Is it a str value?

  • type_maybe($child)

    Is it maybe a $child value?

  • type_hash(\%schema)

    type_hash(
        {
            x => type_str,
            y => type_int,
        }
    );
    

    Is it a hash contains valid keys?

  • type_array()

    type_array(
        type_hash({
            x => type_str,
            y => type_int,
        })
    );
    
  • type_bool()

    Is it a boolean value?

    This function allows only JSON::true, JSON::false, \1, and \0.

OPTIONS

  • $STRICT

    You can check a type more strictly.

    This option is useful for checking JSON types.

  • $ALLOW_EXTRA

    You can allow extra key in hashref.

AUTHOR

Tokuhiro Matsuno tokuhirom@gmail.com

SEE ALSO

LICENSE

Copyright (C) Tokuhiro Matsuno

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

Something went wrong with that request. Please try again.