NAME

Data::Sah::Resolve - Resolve Sah schema

VERSION

This document describes version 0.001 of Data::Sah::Resolve (from Perl distribution Data-Sah-Resolve), released on 2016-07-19.

SYNOPSIS

use Data::Sah::Resolve qw(resolve_schema);

my $sch = resolve_schema("int");
# => ["int", []]

my $sch = resolve_schema("posint*");
# => ["int", {req=>1, min=>0}, {}]

my $sch = resolve_schema([posint => div_by => 3]);
# => ["int", {min=>0, div_by=>3}, {}]

my $sch = resolve_schema([array => of=>"posint*"]);
# => ["array", {of=>["int", {req=>1, min=>0}, {}]}, {}]

DESCRIPTION

FUNCTIONS

resolve_schema([ \%opts, ] $sch) => sch

Extract all subschemas found inside Sah schema $sch. Schema will be normalized first, then schemas from all clauses which contains subschemas will be collected recursively.

Known options:

  • schema_is_normalized => bool (default: 0)

    When set to true, function will skip normalizing schema and assume input schema is normalized.

  • merge_clause_sets => bool (default: 1)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Data-Sah-Resolve.

SOURCE

Source repository is at https://github.com/perlancar/perl-Data-Sah-Resolve.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Resolve

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.

SEE ALSO

Sah, Data::Sah

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 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.