package Mojolicious::Plugin::Args;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON 'decode_json';
sub register {
my ( $self, $app, $opts ) = @_;
$opts->{ '-want-detail' } //= 0 unless ex
n/json' ) or
( $c->req->method eq 'GET' and defined $stash->{format} and $stash->{format} eq 'json' and defined $args{json} ) ) {
my @args = keys %args;
my $json =
decode_json( $c->req->method eq 'GET' ? delete $args{json} : $c->req->body );
my @json = keys %{ $json };
do {
$args{__args}->{ $_ } = $args{ $_ } for @args;