Skip to content

Instantly share code, notes, and snippets.

View augensalat's full-sized avatar

Bernhard Graf augensalat

  • Berlin, Germany
View GitHub Profile
@augensalat
augensalat / collectionformat.t
Last active November 7, 2019 17:39
Swagger2: collectionFormat is optional for multi-value parameters
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);
},
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";