ackage Data::Transit::Writer::JSONVerbose;
use strict;
use warnings;
no warnings 'uninitialized';
our $VERSION = '0.8.04';
use parent 'Data::Transit::Writer';
use JSON;
sub new {
my ($self, $outp
eturn $self->SUPER::new($output, %args);
}
sub _encode {
my ($self, $data) = @_;
return encode_json($data);
}
sub _wrap_top_level_scalar {
my ($self, $converted_data) = @_;
return {"~#'" => $con
is($exptxt, $doc->value,
"Serializing/Deserializing UTF-8 characters (not bytes!) = FMT_JSON");
$doc->format('utf8');
$o->upsert($doc);
$o->get($doc);
is($exptxt, $doc->valu
ois.kisa.or.kr에서 서비스 되고 있습니다.";
my $doc = Couchbase::Document->new('utf8json', { string => $txt });
my $cb = $self->cbo;
$cb->upsert($doc);
$cb->get($doc);
is
my $json = $c->stash('json');
unless ( defined $json->{data} ) {
$json->{data} = {};
$c->stash( 'json' => $json );
=head1 MOJOLICIOUS HOOKS
This module installs an before_render application hook, which gurantees JSON output.
Refer L<Mojolicious::Controller::REST> documentation for output format.
Hook installati
SCRIPTION
This class implements L<Spreadsheet::Template::Processor>, and just passes
through the JSON data without modification.
=for Pod::Coverage process
=head1 AUTHOR
Jesse Luehrs <doy@tozt.n
right cell, or by an
Excel-style range (like C<A1:C3>).
=item true
Returns C<JSON::true>.
=item false
Returns C<JSON::false>.
=back
=head1 ATTRIBUTES
=head2 syntax
Which Xslate syntax engine
$defaults{invalid} //= sub {
my $controller = shift;
return (
json => { json => { error => 'HTTP 401: Unauthorized' } },
html => { template => 'auth/basi
{
invalid => sub {
my $controller = shift;
return (
json => { json => { error => 'HTTP 401: Unauthorized' } },
html => { template => 'auth/ba
quest body within
# [START] and [END] tags
# request_body :
# [START]
# xml or json or form based
# [END]
################
#Set below values to configure the base URL for all te
head1 CONFIGURATION
C<Twirc> uses L<Config::Any>, so you can configure C<twirc> using XML, YAML,
JSON, Apache-style configuration, Windows INI file format, or even Perl code.
A configuration file is
package WebService::Cryptsy;
use Moo;
our $VERSION = '1.008007'; # VERSION
use URI;
use JSON::MaybeXS;
use LWP::UserAgent;
use Digest::SHA qw/hmac_sha512_hex/;
use HTTP::Request::Common qw/POST/;
lf, $json, $method ) = @_;
unless ( $json ) {
$self->error('Network error: got no data');
return
}
$self->error( undef );
my $decoded = eval { decode_json( $json );
};
if ( $@ ) {
$self->error('JSON parsing error: ' . $@);
return;
}
unless ( $decoded and $decoded->{success} ) {
$self->error( $decoded && $decoded->{error}
gs = OPf_KIDS;
cUNOPx(my_op)->op_first = argop;
return my_op;
}
static OP *myck_entersub_json_number(pTHX_ OP *entersubop,
GV *namegv, SV *protosv)
{
OP *pushop, *argop;
entersubo
ing = NULL;
op_free(entersubop);
return gen_numify_op(argop);
}
static OP *myck_entersub_json_string(pTHX_ OP *entersubop,
GV *namegv, SV *protosv)
{
OP *pushop, *argop;
entersubo
MODULE = JSON::XS::Sugar PACKAGE = JSON::XS::Sugar
PROTOTYPES: DISABLE
BOOT:
{
XOP *xop;
CV *json_number_cv = get_cv("JSON::XS::Sugar::json_number", 0);
cv_set_call_checker(json_number_
s qw(compile);
use Types::Standard -types;
use Errno qw(EINTR);
use Scalar::Util qw(blessed);
use JSON::XS;
use Carp;
$Carp::Internal{ (__PACKAGE__) }++;
use Module::Runtime qw(use_module);
require by
xes, $links ) = $check->(@_);
($content_type //= 'application/json')
eq 'application/json'
and $value = encode_json($value);
$self->_store( $bucket, $key, $value, $content_type
if we need to decode
$args->{decode} && ($content_type // '') eq 'application/json'
and return \decode_json($value);
# simply return the value
return \$value;
}
sub _store {
m
);
$client->is_alive() or die "riak is not alive";
# store hashref. will be serialized as JSON
$client->put( 'bucket_name', 'key_name', { some => 'structure' } );
# store text
$client->
ue as first argument. If the content_type
of the fetched value is C<'application/json'>, automatically decodes the JSON
into a Perl structure. If you need the raw data you can use C<get_raw>.
=head2
client->get_raw($bucket, $key, $coderef);
Same as C<get>, but no automatic JSON decoding will be performed. If you want
JSON to be automatically decoded, you should use C<get()> instead.
=head2 put(
8001;
use strict;
use warnings;
our $VERSION = "0.04";
use Github::Hooks::Receiver::Event;
use JSON;
use Plack::Request;
use Class::Accessor::Lite (
new => 1,
ro => [qw/secret/],
);
sub ev
ST']];
}
# Parse JSON payload
my $payload_json;
if (lc $req->header('content-type') eq 'application/json') {
$payload_json = $req->content;
} elsif
ation/x-www-form-urlencoded') {
$payload_json = $req->param('payload');
}
my $payload = eval { decode_json $payload_json }
or return [400, [], ['BAD REQUEST']];
Spreadsheet::Template::Helpers::Xslate::VERSION = '0.05';
use strict;
use warnings;
use JSON;
my $JSON = JSON->new;
use Sub::Exporter 'build_exporter';
my $import = build_exporter({
exports =>
$contents, $format, $type, %args) = @_;
$type = 'string' unless defined $type;
return $JSON->encode({
contents => "$contents",
format => _formats($package, $format),
$contents, $format, $type, %args) = @_;
$type = 'string' unless defined $type;
return $JSON->encode({
range => _parse_range($range),
contents => "$contents",
form
e;
# ABSTRACT: create new templates from existing spreadsheets
use Class::Load 'load_class';
use JSON;
has parser_class => (
is => 'ro',
isa => 'Str',
default => 'Spreadsheet:
self = shift;
my ($filename) = @_;
my $data = $self->parser->parse($filename);
return JSON->new->pretty->canonical->encode($data);
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__EN
my $generator = Spreadsheet::Template::Generator->new;
open my $fh, '>:encoding(utf8)', 'out.json';
$fh->print($generator->generate($filename));
=head1 DESCRIPTION
This module is used to crea
;
use Moose;
# ABSTRACT: generate spreadsheets from a template
use Class::Load 'load_class';
use JSON;
has processor_class => (
is => 'ro',
isa => 'Str',
default => 'Spreadshe
return $class->new($self->processor_options);
},
);
has json => (
is => 'ro',
default => sub {
return JSON->new;
}
);
sub _writer {
my $self = shift;
my $class
late, $vars);
# not decode_json, since we expect that we are already being handed a
# character string (decode_json also decodes utf8)
my $data = $self->json->decode($contents);
return
t;
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
use Carp;
use HTTP::Tiny;
use JSON::PP;
use MIME::Base64;
sub new {
my ($class, @params) = @_;
croak "You should use new
nsport_security_state_static.json?format=TEXT';
my $base64_content = $self->_get_content_from_url( $url );
my $content = decode_base64 $base64_content;
my $json = $self->_get_data_without_
comments( $content );
my $data = decode_json $json;
return $data;
}
sub _get_data_without_comments {
my ($self, $data) = @_;
my $output;
foreach my $line (split /\n/, $data) {
by any classes which consume this
role. It should take the contents of the template and return a JSON file as
described in L<Spreadsheet::Template>. This typically just means running it
through a tem
}
$properties = {
map {
my $v = $properties->{$_};
$_ => JSON::is_bool($v) ? ($v ? 1 : 0)
: $_ eq 'left' ? $border{$v}
: $
ies->{pattern}}
unless $format_properties->{pattern} =~ /^\d+$/;
}
my $key = JSON->new->canonical->encode($format_properties);
if (exists $self->_formats->{$key}) {
re
package Net::Amazon::IAM;
use Moose;
use URI;
use Carp;
use JSON;
use URI::Encode;
use XML::Simple;
use POSIX qw(strftime);
use LWP::UserAgent;
use LWP::Protocol::https;
use Data::Dumper qw(Dumper);
Path => { type => SCALAR, optional => 1 },
});
$args{'PolicyDocument'} = encode_json delete $args{'PolicyDocument'};
my $xml = $self->_sign(Action => 'CreatePolicy', %args);
result = %{$xml->{'GetPolicyVersionResult'}{'PolicyVersion'}};
$result{'Document'} = decode_json(URI::Encode->new()->decode($result{'Document'}));
return Net::Amazon::IAM::PolicyVersion->n