t::Common;
use JSON;
use lib qw(t/lib);
use Test::WWW::Mechanize::Catalyst 'MyApp';
my $mech = Test::WWW::Mechanize::Catalyst->new();
$mech->add_header('Accept' => 'application/json');
$mech->get
$json = JSON::decode_json($mech->content), 'response is JSON response');
is($json->{results}, 0, 'no results');
my $res = $mech->request(POST '/user', [name => 'bar', password => 'foo']);
ok($json
= JSON::decode_json($res->content), 'response is JSON response');
is($json->{success}, 'true', 'submission was successful');
is($res->header('location'), 'http://localhost/user/1', 'user location is
se JSON::Any;
use Carp qw(croak);
use POSIX qw(strftime);
use HTTP::Request;
use File::XDG;
use File::Spec;
use HTTP::Cookies;
use HTML::Entities qw(decode_entities);
use Try::Tiny;
my $json = JSON::
e?";
$url .= "start=$start&end=$end";
$self->agent->get($url);
# Decode JSON
my $data = $json->decode( $self->agent->content );
# Decode HTML entities.
foreach my $record
w));
my $text = $args{text} or croak "set_done requires a 'text' argument";
my $done_json = $json->encode({
calendar => $self->user,
owner => $self->user,
{
$WebService::Diffbot::VERSION = '0.003';
}
use Moo;
use namespace::clean;
use JSON qw( decode_json encode_json );
use LWP::UserAgent;
has api_url => ( is => 'ro', default => sub { 'http://api.d
serAgent->new->get($uri);
die $response if !$response->is_success;
my $content = decode_json $response->decoded_content;
die $content->{error} if $content->{error};
print STDERR $co
';
## <?= $method ?> <?= $path ?>
? if ($description) {
<?= $description ?>
? }
### Request
```json
<?= $method ?> <?= $path ?><?= $query ? '?'.$query : '' ?>
<?= $request_body ?>
```
? if ($rule)
$rule->{$name}{$key}) {
* <?= $key ?>: **<?= $rule->{$name}{$key} || '' ?>**
? }
? }
? }
? }
### Response
```json
Status: <?= $code ?>
<?= $response_body ?>
```
---
END
return $tmpl;
}
1;
package Test::Shodo::JSONRPC;
use strict;
use warnings;
use Shodo;
use parent qw/Exporter/;
use JSON qw/from_json/;
use Try::Tiny;
use Test::More;
our @EXPORT = qw/
shodo_document_root
shodo_
req_ok {
my ($req, $note) = @_;
$suzuri->request($req);
my $data = try {
from_json($req->content);
}catch{
warn "$_\n";
};
return unless $data;
return unles
hodo::JSONRPC - Test module using Shodo for JSON-RPC Web API
=head1 SYNOPSIS
use Test::More;
use Plack::Test;
use HTTP::Request;
use JSON qw/to_json/;
use Test::Shodo::JSONRPC;
VERSION
version 0.002000
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Net::Minecraft::Role::LoginResult",
"interface":"role"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan.
aders>
=head2 C<http_engine>
=begin MetaPOD::JSON v1.1.0
{
"namespace":"Net::Minecraft::Role::HTTP",
"interface":"role"
}
=end MetaPOD::JSON
=head1 AUTHOR
Kent Fredric <kentnl@cpan.org>
ntended to allow easy passing of a plain old perl data structure to a
serialization module like L<JSON> or L<YAML>.
=head1 METHODS
=head2 serialize
serialize to a perl hashref
=head1 BUGS
Please
if ( env_true('AUTHOR_TESTING') or env_true('RELEASE_TESTING') ) {
my $prereqs = parse_meta_json()->effective_prereqs;
my $reqs = $prereqs->requirements_for( 'develop', 'requires' );
my
'cpu', 'rss' ) {
$result->{ $metric } = $rrd->find_rrds( $dir );
}
$self->render( json => $result );
};
app->start;
# each route can perform overrides from the defaults with this met
= cwd();
chdir '/tmp/cpan-fixes';
cpanm(@params);
chdir $cwd;
}
sub parse_meta_json {
$_[0] ||= 'META.json';
require CPAN::Meta;
return CPAN::Meta->load_file( $_[0] );
}
sub import {
m
ixes;
$caller_stash->{cpanm_fix} = *cpanm_fix;
$caller_stash->{parse_meta_json} = *parse_meta_json;
$caller_stash->{capture_stdout} = *capture_stdout;
$caller_stash->{deploy_st
egin MetaPOD::JSON v1.1.0
{
"namespace":"Net::Minecraft::Login",
"inherits":"Moo::Object",
"does":"Net::Minecraft::Role::HTTP",
"interface":"class"
}
=end MetaPOD::JSON
=head1 AUTH
turns C<undef> here.
=cut
sub get_time { undef }
=head2 TO_JSON()
Meant to be called by the L<JSON> family of modules to create a JSON
representation of the OID. So, for example, "4162F712-1DD2-11
"4162F712-1DD2-11B2-B17E-C09EFE1DC403" }>.
my $json = JSON->new->allow_blessed->convert_blessed;
$json->encode(MorboDB::OID->new);
=cut
sub TO_JSON { { '$oid' => shift->value } }
sub _build_valu
taPOD::JSON v1.1.0
{
"namespace":"Net::Minecraft::LoginResult",
"inherits":"Moo::Object",
"does":"Net::Minecraft::Role::LoginResult",
"interface":"class"
}
=end MetaPOD::JSON
=head
package Shodo::Suzuri;
use strict;
use warnings;
use Carp qw//;
use Try::Tiny;
use JSON qw/from_json to_json/;
use Data::Validator;
use Clone qw/clone/;
sub new {
my ($class, %args) = @_;
my
pe =~ m!^application/json!) {
my $json_body = to_json(from_json($self->stash->{request_body}, { utf8 => 1 }), { pretty => 1 });
$self->stash->{request_body} = $json_body;
}
ret
e =~ m!^application/json!) {
my $json_body = to_json(from_json($self->stash->{response_body}, { utf8 => 1}), { pretty => 1 });
$self->stash->{response_body} = $json_body;
}
ret
taPOD::JSON v1.1.0
{
"namespace":"Net::Minecraft::LoginFailure",
"inherits":"Moo::Object",
"does":"Net::Minecraft::Role::LoginResult",
"interface":"class"
}
=end MetaPOD::JSON
=hea
full => 1, # return all available information
);
Returns a hashref directly from the JSON response of the xsearch API
described at L<http://librishelp.libris.kb.se/help/xsearch_eng.jsp?op
> 200, # max. number of results
start => 1 + 200 * ($page - 1),
format => 'json',
);
$q{format_level} = 'full' if $opts{full};
my $url = Mojo::URL->new('http://libri
;
$res->json;
}
sub search {
my ($self, %opts) = @_;
my $json = $self->direct_search(%opts);
my @ids = map { (split '/', $_->{identifier})[-1] }
@{ $json->{xsearch}
$self->render_to_rel_file('fixture_config', "$name/share/$mode/fixtures/1/conf/all_tables.json");
};
# tests
$self->render_to_rel_file('test', "$name/t/basic.t", $class );
#
| | `-- 1.fix
| | `-- conf
| | `-- all_tables.json
| |-- production
| | `-- fixtures
| | `-- 1
| | |-- all
| | `-- 1.fix
| | `-- conf
| | `-- all_tables.json
| `-- testing
| `-- fixtures
| `-- 1
| |-- all_ta
use 5.012;
use LWP::UserAgent::Determined 1.06;
use Try::Tiny 0.18;
use XML::LibXML 2.0108;
use JSON 2.90;
has 'ua' => (
is => 'lazy',
isa => quote_sub(q{
die 'Not a LWP::UserAgent::Determ
:isa($_[0], 'XML::LibXML');
})
);
has 'jsonparser' => (
is => 'lazy',
isa => quote_sub(q{
die 'Not a JSON'
unless UNIVERSAL::isa($_[0], 'JSON');
})
);
sub marketstat {
my ($sel
_proxy;
return $ua;
}
sub _build_libxml {
return XML::LibXML->new;
}
sub _build_jsonparser {
return JSON->new->utf8;
}
1; # End of Games::EveOnline::EveCentral
__END__
=pod
=head1 NAME
= cwd();
chdir '/tmp/cpan-fixes';
cpanm(@params);
chdir $cwd;
}
sub parse_meta_json {
$_[0] ||= 'META.json';
require CPAN::Meta;
return CPAN::Meta->load_file( $_[0] );
}
sub import {
m
ixes;
$caller_stash->{cpanm_fix} = *cpanm_fix;
$caller_stash->{parse_meta_json} = *parse_meta_json;
$caller_stash->{capture_stdout} = *capture_stdout;
$caller_stash->{deploy_st