This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojo::Base -strict; | |
use Test::Mojo; | |
use Test::More; | |
use Mojolicious::Lite; | |
get '/pets' => sub { | |
my $c = shift->openapi->valid_input or return; | |
$c->render(openapi => $c->validation->output); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MMojo::Util=dumper -MYAML -wE ' | |
no warnings "once"; | |
sub Vault::yaml_load { | |
my ($class, $node) = @_; | |
my ($h, $s) = sub { my @l = split /\n/, $$node; return (shift @l, join("", @l)) }->(); | |
my %h; | |
@h{qw(blurb version encryption id)} = split /;/, $h; | |
bless {%h, secret => $s}, $class; | |
} | |
$YAML::TagClass->{vault} = "Vault"; |
OlderNewer