package App::yajg::Output::Json;
use 5.014000;
use strict;
use warnings;
use utf8;
use parent qw(App::yajg::Output);
use App::yajg;
use JSON qw();
sub lang {'js'} # lang for highli
my $self = shift;
local $SIG{__WARN__} = \&App::yajg::warn_without_line;
my $json = eval {
JSON
->new
->pretty(not $self->minimal)
->canonical($self->so
rt_keys // 0)
->allow_nonref
->encode($self->data)
};
if ($@) {
warn $@;
return '';
}
return $json;
}
1;
lass::InflateColumn::Serializer::JSON;
$DBIx::Class::InflateColumn::Serializer::JSON::VERSION = '0.09';
=head1 NAME
DBIx::Class::InflateColumn::Serializer::JSON - JSON Inflator
=head1 SYNOPSIS
pa
mn' => {
'data_type' => 'VARCHAR',
'size' => 255,
'serializer_class' => 'JSON',
'serializer_options' => { allow_blessed => 1, convert_blessed => 1, pretty => 1 }, # o
ill be saved in the database in JSON format.
Any arguments included in C<serializer_options> will be passed to the L<JSON::MaybeXS> constructor,
to be used by the JSON backend for both serializing an
package XAS::Lib::Log::Json;
our $VERSION = '0.01';
use XAS::Factory;
use XAS::Class
debug => 0,
version => $VERSION,
base => 'XAS::Base',
utils => ':validation level2sys
log',
codec => 'JSON',
accessors => 'spooler',
constants => 'HASHREF',
filesystem => 'Dir',
;
# note to self: Don't but $self->log->debug() statements in here
# it will produce a nice
'),
uc($args->{'priority'}),
$args->{'message'}
);
# create a logstash "json_event"
my $data = {
'@timestamp' => $args->{'datetime'}->strftime('%Y-%m-%dT%H:%M:%S
package XAS::Lib::RPC::JSON::Server;
our $VERSION = '0.04';
use POE;
use Try::Tiny;
use Set::Light;
use XAS::Class
debug => 0,
version => $VERSION,
base => 'XAS::Lib::Net::Server',
utils => ':validation dotid',
accessors => 'methods',
codec => 'JSON',
constants => 'HASH ARRAY :jsonrpc ARRAYREF HASHREF',
;
my $ERRORS = {
'-32700' => 'Parse Error',
'-3260
,
{ type => HASHREF }
]);
my $json;
my $alias = $self->alias;
$self->log->debug("$alias: entering process_response");
$json = $self->_rpc_result($ctx->{'id'}, $output);
PC::JSON::Client;
our $VERSION = '0.02';
use XAS::Class
debug => 0,
version => $VERSION,
base => 'XAS::Lib::Net::Client',
utils => ':validation dotid',
codec => 'JSON',
constants => ':jsonrpc HASHREF',
;
use Data::Dumper;
# ----------------------------------------------------------------------
# Public Methods
# ---------------------------------------------------
$key =~ s/^-//;
$params->{$key} = $value;
}
my $packet = {
jsonrpc => RPC_JSON,
id => $p->{'id'},
method => $p->{'method'},
params => $pa
::AppKit::View::JSON;
use base qw( Catalyst::View::JSON );
__PACKAGE__->config(
expose_stash => 'json',
);
__END__
=pod
=encoding UTF-8
=head1 NAME
OpusVL::AppKit::View::JSON
=head1 VERSIO
N
version 2.29
=head1 DESCRIPTION
This is our JSON view. It only exposes the json key from the stash.
1;
=head1 NAME
OpusVL::AppKit::View::JSON
=head1 AUTHOR
OpusVL - www.opusvl.com
=head1 C
e JSON5;
use 5.008001;
use strict;
use warnings;
our $VERSION = "0.01";
use Exporter 'import';
our @EXPORT = qw/decode_json5/;
use JSON::PP;
use JSON5::Parser;
my $JSON5; # cache
sub decode_json5
{ ($JSON5 ||= JSON5->new->utf8)->decode(@_) }
sub new {
my $class = shift;
return bless {
parser => JSON5::Parser->new,
} => $class;
}
sub true;
sub false;
*true = \&JSON::PP::
true;
*false = \&JSON::PP::false;
# define accessors
BEGIN {
for my $attr (qw/utf8 allow_nonref max_size inflate_boolean inflate_nan inflate_null inflate_infinity/) {
my $attr_accessor =
package Stepford::Grapher::Renderer::Json;
use strict;
use warnings;
use namespace::autoclean;
use autodie;
use JSON::PP qw( encode_json );
use Moose;
our $VERSION = '1.01';
with(
'Stepford::
pen as raw because encode_json produces bytes not chars
open $fh, '>:raw', $self->output;
}
print $fh encode_json($data)
or die "Problem printing JSON: $!";
return;
}
__P
e_immutable;
1;
# ABSTRACT: Render to a JSON data structure
__END__
=pod
=encoding UTF-8
=head1 NAME
Stepford::Grapher::Renderer::Json - Render to a JSON data structure
=head1 VERSION
version
package JSON5::Parser;
use strict;
use warnings;
use utf8;
use Carp qw/croak/;
use JSON::PP;
use Encode;
our $ROOT;
our $POINTER;
sub new {
my $class = shift;
return bless +{
utf8
=> 0,
max_size => 0,
inflate_boolean => sub { $_[0] eq 'true' ? JSON::PP::true : JSON::PP::false },
inflate_nan => sub { 0+'NaN' },
inflate_null => s
= length $content;
$bytes <= $max_size
or croak sprintf 'attempted decode of JSON5 text of %s bytes size, but max_size is set to %s', $bytes, $max_size;
}
if ($self->{utf8
package Parallel::Scoreboard::PSGI::App::JSON;
use Class::Accessor::Lite;
use JSON qw(encode_json decode_json);
use Parallel::Scoreboard;
use strict;
use warnings;
Class::Accessor::Lite->mk_accesso
$s = decode_json($s);
};
}
return [
200,
[ 'Content-Type' => 'application/json; charset=utf-8' ],
[ encode_json($status) ],
1;
__END__
=head1 NAME
Parallel::Scoreboard::PSGI::App::JSON - a simple PSGI app for monitoring the output of Parallel::Scoreboard in JSON format
=head1 SYNOPSIS
use Parallel::Scoreboard;
use
e Net::Lumberjack::Frame::JSON;
use Moose;
# ABSTRACT: class for parsing Lumberjack JSON frames
our $VERSION = '1.02'; # VERSION
extends 'Net::Lumberjack::Frame';
use JSON;
has 'type' => ( is =>
lt => sub {
my $self = shift;
my $json_str = encode_json( $self->data );
my $len = length($json_str);
return pack('NN', $self->seq, $len).$json_str;
},
);
sub _read_payload {
my (
$self->data( decode_json($self->_read_data($fh)) );
return;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Net::Lumberjack::Frame::JSON - class for parsing Lumberjack JSON frames
=head1 VERS
ool::Command::client::json;
use strict;
use warnings;
use base qw( App::MatrixTool::Command::client );
our $VERSION = '0.08';
use constant DESCRIPTION => "Perform a direct JSON request";
use consta
"HTTP method",
);
=head1 NAME
matrixtool client json - Perform a direct JSON request
=head1 SYNOPSIS
$ matrixtool client -u @me:example.com json /_matrix/client/r0/publicRooms
=head1 DESCRIPTI
ould
contain a JSON encoding of data to supply with the request, turning it into a
C<PUT> request. If no data is supplied, then a C<GET> request is performed
instead.
The resulting JSON data from the
ountersOutput::JSON;
use strict;
use warnings;
# ABSTRACT: plugin to dump counters in JSON format
our $VERSION = '1.6'; # VERSION
use base 'Log::Saftpresse::CountersOutput';
use JSON;
sub output
{
my ( $self, $counters ) = @_;
my $json = JSON->new;
$json->pretty(1);
my %data = map {
$_ => $counters->{$_}->counters,
} keys %$counters;
print $json->encode( \%data );
return;
}
1;
__E
ND__
=pod
=encoding UTF-8
=head1 NAME
Log::Saftpresse::CountersOutput::JSON - plugin to dump counters in JSON format
=head1 VERSION
version 1.6
=head1 AUTHOR
Markus Benning <ich@markusbenning.
Output::JSON;
use Moose;
# ABSTRACT: plugin to dump events to in JSON to stdout
our $VERSION = '1.6'; # VERSION
extends 'Log::Saftpresse::Output';
has 'json' => (
is => 'ro', isa => 'JSON', lazy
=> 1,
default => sub {
my $j = JSON->new;
$j->utf8(1); $j->pretty(1); $j->allow_blessed(1);
return $j;
},
);
sub output {
my ( $self, @events ) = @_;
foreach my $event (@events) {
my %
->dump_json_data( \%output );
}
return;
}
sub _backend {
my $self = shift;
if( defined $self->{'_backend'} ) {
return $self->{'_backend'} ;
}
foreach my $module ( 'JSON::Color', 'JSON') {
::JSON;
$Magpie::Transformer::JSON::VERSION = '1.163200';
use Moose;
# ABSTRACT: JSON Ouput Transformer
extends 'Magpie::Transformer';
use Scalar::Util qw(blessed);
use Magpie::Constants;
use JSON;
if ( $self->resource->has_data ) {
my $data = $self->resource->data;
my $json_string = undef;
if ( blessed $data) {
if ($data->does('Data::Stream::Bulk') )
ects, JSON::encode_json($data);
}
}
$json_string = '[' . ( join ', ', @objects ) . ']';
}
else {
$json_strin
ie/File/Indexed/JSON.pm
## Author: Bryan Jurish <moocow@cpan.org>
## Description: tied array access to indexed data files: JSON-encoded data structures
package Tie::File::Indexed::JSON;
use Tie::File
)
## $tfi = CLASS->new($file,%opts)
## + new %opts, object structure:
## (
## json => $json, ##-- JSON object or HASH-ref of options
## )
## \%defaults = CLASS_OR_OBJECT->defaults()
#
# + default attributes for constructor
sub defaults {
return (
$_[0]->SUPER::defaults,
json => {utf8=>1, relaxed=>1, allow_nonref=>1, allow_unknown=>1, allow_blessed=>1, convert_blessed=>1, p
package JSON::Schema::Shorthand;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Alternative, condensed format for JSON Schemas
$JSON::Schema::Shorthand::VERSION = '0.0.2';
use strict;
use warnings;
use
d
=encoding UTF-8
=head1 NAME
JSON::Schema::Shorthand - Alternative, condensed format for JSON Schemas
=head1 VERSION
version 0.0.2
=head1 SYNOPSIS
use JSON::Schema::Shorthand;
my $sch
bar => { type => string },
# }
# required => [ 'bar' ],
# }
=head1 DESCRIPTION
JSON Schema
is a useful beast,
but its schema definition can be a little bit more long-winded
than n
der::Ext::json;
$Ubic::ServiceLoader::Ext::json::VERSION = '1.60';
# ABSTRACT: loader for json-style configs
use strict;
use warnings;
use parent qw( Ubic::ServiceLoader::Base );
use JSON;
{
with JSON.pm v1 just because we can
# see also: Ubic::Persistent
no strict;
no warnings;
sub jsonToObj; *jsonToObj = (*{JSON::from_json}{CODE}) ? \&JSON::from_json : \&JSON::jsonToObj
= do { local $/; <$fh> };
close $fh or die "Can't close $file: $!";
my $config = eval { jsonToObj $content };
unless ($config) {
die "Failed to parse $file: $@";
}
my $m
OAuth::Lite2::Formatter::JSON;
use strict;
use warnings;
use parent 'OAuth::Lite2::Formatter';
use JSON::XS;
use Try::Tiny;
sub name { "json" }
sub type { "application/json" };
sub format {
m
return JSON::XS->new->encode($hash);
}
sub parse {
my ($self, $json) = @_;
return JSON::XS->new->decode($json);
}
=head1 NAME
OAuth::Lite2::Formatter::JSON - OAuth 2.0 JSON formatters
matter = OAuth::Lite2::Formatter::JSON->new;
my $obj = $formatter->parse( $string );
$string = $formatter->format( $obj );
=head1 DESCRIPTION
OAuth 2.0 JSON formatter
=head1 METHODS
=head2
App::JSON::Tools;
use 5.008001;
use strict;
use warnings;
our $VERSION = "0.01";
1;
__END__
=encoding utf-8
=head1 NAME
App::JSON::Tools - command line json tools
=head1 SYNOPSIS
json-pat
h -h
json-pointer -h
=head1 DESCRIPTION
=head1 LICENSE
Copyright (C) Eric Johnson.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.