Sah::Schemas::Examples - Various example Sah schemas
This document describes version 0.009 of Sah::Schemas::Examples (from Perl distribution Sah-Schemas-Examples), released on 2021-07-30.
The following schemas are included in this distribution:
array_of_int
Array of integers.
array_of_posint
Array of positive integers.
example::foo
A sample schema.
This is just a simple schema based on str with no additional restriction clauses.
str
example::has_merge
Even integer.
This schema is based on "posint", which is ["int", {min=>1}], and adds another clause div_by=>2. However, this schema also deletes the min=>1 clause using merge key: merge.delete.min=>undef. Thus, the resolved result becomes ["int", {div_by=>2}] which is basically "even integer". Without the merge key, this schema would become "positive even integer."
example::recurse1
Recursive schema.
This schema will cause the resolver Data::Sah::Resolve to bail because it recurses to itself.
example::recurse2a
example::recurse2b
This schema will cause the resolver Data::Sah::Resolve to bail because it eventually recurses to itself.
hash_of_int
Hash of integers.
hash_of_posint
Hash of positive integers.
ints
posints
Please visit the project's homepage at https://metacpan.org/release/Sah-Schemas-Examples.
Source repository is at https://github.com/perlancar/perl-Sah-Schemas-Examples.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Sah-Schemas-Examples
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Sah - schema specification
Data::Sah - Perl implementation of Sah
perlancar <perlancar@cpan.org>
This software is copyright (c) 2021, 2020, 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sah::Schemas::Examples, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sah::Schemas::Examples
CPAN shell
perl -MCPAN -e shell install Sah::Schemas::Examples
For more information on module installation, please visit the detailed CPAN module installation guide.