ncy/auth/unauthorized',
status => 401,
);
$c->respond_to(
json => {},
html => {},
);
return undef;
};
}
1;
__END__
=pod
=hea
horized result
if ( grep { $_ eq 'api' } @{ $c->req->url->path } ) {
# Render JSON unauthorized response
$c->render(
handler => 'openapi', # XXX This st
exists,
#pod that will be called, and must return the initial JSON schema for Yancy.
#pod
#pod A very useful possibility is for that JSON schema to just contain
#pod C<<{ 'x-ignore' => 1 }>>.
#pod
#p
lar::Util qw( looks_like_number blessed );
use Mojo::Loader qw( load_class );
use Mojo::JSON qw( true encode_json );
BEGIN {
eval { require DBIx::Class; DBIx::Class->VERSION( 0.082842 ); 1 }
$self->normalize( $schema_name, $params );
die "No refs allowed in '$schema_name': " . encode_json $params
if grep ref && ref ne 'SCALAR', values %$params;
my $created = $self->driver-
nd';
use Role::Tiny 'with';
use Scalar::Util qw( blessed looks_like_number );
use Mojo::JSON qw( true encode_json );
use Carp qw( croak );
use Yancy::Util qw( is_type is_format );
with 'Yancy::Backen
to Local::Test
use Mojo::Base '-base';
use List::Util qw( max );
use Mojo::JSON qw( true false from_json to_json encode_json );
use Mojo::File qw( path );
use Storable qw( dclone );
use Role::Tiny qw
path ) = $url =~ m{^[^:]+://[^/]+(?:/(.+))?$};
if ( $path ) {
%DATA = %{ from_json( path( ( $ENV{MOJO_HOME} || () ), $path )->slurp ) };
}
}
$schema //= \%Local::Te
eeded. If validation fails, this helper will throw an
#pod exception with an array reference of L<JSON::Validator::Error> objects.
#pod See L<the validate helper|/yancy.validate> and L<the filter appl
/comment/:id' => sub {
#pod eval { $c->yancy->set( "comment", $c->stash( 'id' ), $c->req->json ) };
#pod if ( $@ ) {
#pod return $c->render( status => 400, errors => $@ );
eeded. If validation fails, this helper will throw an
#pod exception with an array reference of L<JSON::Validator::Error> objects.
#pod See L<the validate helper|/yancy.validate> and L<the filter appl
/ATTRIBUTES>, these
#pod options may be given:
#pod
#pod =over
#pod
#pod =item schema
#pod
#pod A JSON schema configuration. By default, the information from
#pod L</read_schema> will be merged with t
e, json_schema => $data );
}
$self->_schema->{$name} = $data;
return $self;
}
#pod =method json_schema
#pod
#pod Get the JSON Schema for every attached schema.
#pod
#pod =cut
sub json_sc
!@names ) {
@names = $self->schema_names;
}
return {
map { $_ => $self->schema( $_ )->json_schema } @names
};
}
#pod =method schema_names
#pod
#pod Get a list of all the schema names.
#