Sah::S...lt_meta(3pm)

πŸ“¦
version 1.1.98.0 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Sah::Schema::rinci::result_meta πŸ’–

okay bestie, so this is the manual page for Sah::Schema::rinci::result_meta β€” it's the Rinci envelope result metadata schema, no cap. (Yeah the title got squished to Sah::S...lt_meta in the header, the full name is the one up there ⬆️, we're keeping it real.)

✨ VERSION ✨

This doc describes version 1.1.98.0 of Sah::Schema::rinci::result_meta, and it ships from the Perl distribution Sah-Schemas-Rinci, released on 2021-07-20. periodt.


🌈 SYNOPSIS 🌈

Wanna check some data against this schema? You're gonna need Data::Sah for that, bestie:

use Data::Sah qw(gen_validator);
my $validator = gen_validator("rinci::result_meta*");
say $validator->($data) ? "valid" : "INVALID!";

# Data::Sah can also create validator that returns nice error message string
# and/or coerced value. Data::Sah can even create validator that targets other
# language, like JavaScript. All from the same schema. See its documentation
# for more details.

Not me dropping the little comment block in there too, because it's part of the vibe and we do NOT skip details in this house πŸ’…


Wanna validate your function parameters against this schema instead? That's a Params::Sah moment:

use Params::Sah qw(gen_validator);

sub myfunc {
    my @args = @_;
    state $validator = gen_validator("rinci::result_meta*");
    $validator->(\@args);
    ...
}

And if you wanna specify the schema inside Rinci function metadata and then let Perinci::CmdLine cook up a whole CLI from it? Iconic behaviour honestly:

# in lib/MyApp.pm
package
  MyApp;
our %SPEC;
$SPEC{myfunc} = {
    v => 1.1,
    summary => 'Routine to do blah ...',
    args => {
        arg1 => {
            summary => 'The blah blah argument',
            schema => ['rinci::result_meta*'],
        },
        ...
    },
};
sub myfunc {
    my %args = @_;
    ...
}
1;

# in myapp.pl
package
  main;
use Perinci::CmdLine::Any;
Perinci::CmdLine::Any->new(url=>'MyApp::myfunc')->run;

# in command-line
% ./myapp.pl --help
myapp - Routine to do blah ...
...

% ./myapp.pl --version

% ./myapp.pl --arg1 ...

(yes the weird package line breaks are intentional, that's literally how it's written, don't come for me πŸ™ˆ)


And here's some sample data so you can see what it's giving:

{}  # valid

{stream=>1}  # valid

Look at that. Two valid examples. She ate and left no crumbs πŸ“


πŸ¦‹ HOMEPAGE πŸ¦‹

Please visit the project's homepage at https://metacpan.org/release/Sah-Schemas-Rinci β€” go say hi, she's lovely.

πŸŽ€ SOURCE πŸŽ€

Source repository is at https://github.com/perlancar/perl-Sah-Schemas-Rinci. go peek at the code, iykyk πŸ‘‘

πŸ’€ BUGS πŸ’€

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

okay real talk: when you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or the feature you want. that's the whole assignment bestie, don't skip it 😭

πŸ’œ AUTHOR πŸ’œ

perlancar <perlancar@cpan.org> β€” shoutout, main character energy fr fr 🌟

This software is copyright (c) 2021, 2020, 2019, 2018, 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.


and that's the whole page, bestie!! 🫢 this was perl v5.36.0 flavoured, generated on 2022-11-19, and it's the Sah::S...lt_meta(3pm) manual β€” go forth and validate responsibly βœ¨πŸŒΈπŸ’–

πŸ“¦ where this page comes from