Group
Extension

Matches 10

APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/JSON.pm ( view source; MetaCPAN )
e APISchema::JSON;
use strict;
use warnings;

use Exporter 'import';
our @EXPORT = qw(encode_json_canonical);

use JSON::XS;

my $json = JSON::XS->new->utf8->canonical(1);

sub encode_json_canonical {

    my ($value) = @_;
    $json->encode($value);
}

1;
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Generator/Markdown/ExampleFormatter.pm ( view source; MetaCPAN )
ter;
use 5.014;
use strict;
use warnings;

# lib
use APISchema::Generator::Markdown::Formatter qw(json);

# cpan
use URI::Escape qw(uri_escape_utf8);
use Class::Accessor::Lite (
    new => 1,
    ro =
e = $self->example($resource);

    return '' unless defined $example;

    return ref $example ? json($example) : $example;
}

sub header_and_body {
    my ($self) = @_;
    join("\n", grep { defined
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Generator/Markdown.pm ( view source; MetaCPAN )
 ?>"></a> `<?= $resource->title ?>` : <?= type($resource->definition) ?>
```javascript
<?= pretty_json $r->example($resource->definition) ?>
```

?= $resource->definition->{description} || ''

#### Pr
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/Plack/App/APISchema/MockServer.pm ( view source; MetaCPAN )
Plack::Util::Accessor qw(schema);
use Plack::Request;
use Encode qw(encode_utf8);

use APISchema::JSON;

use APISchema::Generator::Router::Simple;
use APISchema::Generator::Markdown::ResourceResolver;

    # TODO: format body with encoding
    return [$default_code, ['Content-Type' => 'application/json; charset=utf-8'], [encode_utf8($formatter->body)]];
}

sub router {
    my ($self) = @_;

    ret
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Validator/Decoder.pm ( view source; MetaCPAN )
 cpan
use JSON::XS qw(decode_json);
use URL::Encode qw(url_params_mixed);
use Class::Accessor::Lite ( new => 1 );

sub perl {
    my ($self, $body) = @_;
    return $body;
}

my $JSON = JSON::XS->new-
>utf8;
sub json {
    my ($self, $body) = @_;
    return $JSON->decode($body);
}

sub url_parameter {
    my ($self, $body) = @_;
    return undef unless defined $body;
    return url_params_mixed($bo
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/Plack/Middleware/APISchema/RequestValidator.pm ( view source; MetaCPAN )
lack::Request;
use APISchema::Generator::Router::Simple;
use APISchema::Validator;
use APISchema::JSON;

use constant DEFAULT_VALIDATOR_CLASS => 'Valiemon';

sub call {
    my ($self, $env) = @_;
    
result);
    return [
        $status_code,
        [ 'Content-Type' => 'application/json' ],
        [ encode_json_canonical($errors) ],
    ] if scalar keys %$errors;

    $self->app->($env);
}

sub
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Generator/Markdown/Formatter.pm ( view source; MetaCPAN )
pe json pretty_json code restriction desc anchor method methods content_type http_status http_status_code);

# cpan
use HTTP::Status qw(status_message);
use URI::Escape qw(uri_escape_utf8);
use JSON::
XS ();
my $JSON = JSON::XS->new->canonical(1);

use constant +{
    RESTRICTIONS => [qw(required max_items min_items max_length min_length maximum minimum pattern)],
    SHORT_DESCRIPTION_LENGTH => 10
in $bar, map { code($_) } @{$type} if ref $type eq 'ARRAY';
    }

    return 'undefined';
}

sub json ($) {
    my $x = shift;
    if (ref $x eq 'SCALAR') {
        if ($$x eq 1) {
            $x = '
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Generator/Markdown/ResourceResolver.pm ( view source; MetaCPAN )
PISchema::Generator::Markdown::ResourceResolver;
use 5.014;
use strict;
use warnings;

# cpan
use JSON::Pointer;
use Class::Accessor::Lite (
    new => 1,
    ro  => [qw(schema)],
);

sub _foreach_pro
y $ref = $definition->{'$ref'};
    if ($ref) {
        $ref = $ref =~ s/^#//r;
        my $def = JSON::Pointer->get($self->schema, $ref);
        return $self->_collect_properties($path, $def)
      
y $ref = $definition->{'$ref'};
    if ($ref) {
        $ref = $ref =~ s/^#//r;
        my $def = JSON::Pointer->get($self->schema, $ref);
        return ($self->_collect_example($path, $def), 1) if $
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/Plack/Middleware/APISchema/ResponseValidator.pm ( view source; MetaCPAN )
ack::Response;
use APISchema::Generator::Router::Simple;
use APISchema::Validator;
use APISchema::JSON;

use constant DEFAULT_VALIDATOR_CLASS => 'Valiemon';

sub call {
    my ($self, $env) = @_;

   
           500,
                [ 'Content-Type' => 'application/json', 'X-Error-Cause' => $error_cause ],
                [ encode_json_canonical($errors) ],
            );
            return;
      
APISchema ( A/AK/AKIYM/APISchema-1.37.tar.gz, AKIYM, 2018; MetaCPAN )
APISchema/lib/APISchema/Validator.pm ( view source; MetaCPAN )
 => [qw(header parameter body)],
    DEFAULT_ENCODING_SPEC => {
        'application/json'                  => 'json',
        'application/x-www-form-urlencoded' => 'url_parameter',
        # TODO ya

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.