package Plack::Session::Store::RedisFast::Encoder::JSON;
use strict;
use warnings;
use 5.008_005;
use JSON ();
sub new {
return JSON->new->utf8->allow_nonref;
}
1;
__END__
=pod
=encoding u
tf-8
=head1 NAME
Plack::Session::Store::RedisFast::JSON - L<JSON> adapter for Redis session store.
=head1 DESCRIPTION
L<JSON>-based implementation of L<Plack::Session::Store::RedisFast/inflate>
an
eflate>.
=head1 SYNOPSIS
use Plack::Session::Store::RedisFast::JSON;
my $encoder = Plack::Session::Store::RedisFast::JSON->new;
my $bytes = $encoder->encode( $hashref );
my $hashr
package Config::Files::Simple::JSON;
=encoding UTF-8
=head1 NAME
Config::Files::Simple::JSON - Yet another config file reader.
=head1 VERSION
version 0.03
=cut
our $VERSION = '0.03'; # VER
ined $_[2] ? $_[2] : ['.json'] ) ) {
require Carp;
Carp::cluck("$_[1] seems not to be a JSON file.");
}
require JSON::Parse;
return JSON::Parse::json_file_to_perl( $_[1] );
}
1;
__END__
=pod
=head1 DESCRIPTION
JSON file reader for Config::Files::Simple.
=head1 AUTHOR
Mario Zieschang, C<< <mziescha at cpan.org> >>
=head1 BUGS
Please report any bugs or feature
rage::JSON;
use boolean;
use namespace::autoclean;
use File::DataClass::Functions qw( extension_map throw );
use File::DataClass::Types qw( Object );
use JSON::MaybeXS qw( JSON );
u
ap 'JSON' => '.json';
# Private functions
my $_build_transcoder = sub {
my $options = shift; my $json = JSON->new;
for (grep { $_ ne 'reboolify' } keys %{ $options }) {
$json = $json->$_
( $options->{ $_ } );
}
return $json;
};
my $_reboolify; $_reboolify = sub {
my $in = shift; my $ref = ref $in;
if (not $ref) { return $in }
elsif ($ref eq 'HASH') {
return {
package JSON::RPC::Spec::Client;
use Moo;
use Carp ();
with qw(
JSON::RPC::Spec::Common
);
use namespace::clean;
sub compose {
my ($self, $method, $params, $id) = @_;
my @args;
if (de
jsonrpc => $self->_jsonrpc,
method => $method,
params => $params,
@args
}
);
}
1;
__END__
=encoding utf-8
=head1 NAME
JSON::RPC::Spec:
nt - Yet another JSON-RPC 2.0 Client Implementation
=head1 FUNCTIONS
=head2 compose
use JSON::RPC::Spec::Client;
my $rpc_client = JSON::RPC::Spec::Client->new;
my $json_string = $rpc_cl
package JSON::RPC::Spec::Procedure;
use Moo;
use Carp ();
use Try::Tiny;
with qw(
JSON::RPC::Spec::Common
);
use constant DEBUG => $ENV{PERL_JSON_RPC_SPEC_DEBUG} || 0;
has router => (
is
ternal_error(data => $err);
}
return $error;
}
return +{
jsonrpc => $self->_jsonrpc,
result => $result,
id => $self->_id
};
}
# trigger regis
_END__
=encoding utf-8
=head1 NAME
JSON::RPC::Spec::Procedure - Subclass of JSON::RPC::Spec
=head1 DESCRIPTION
JSON::RPC::Spec::Procedure is Subclass of JSON::RPC::Spec.
=head1 FUNCTIONS
=head2
package Data::Compare::Plugins::JSON;
use strict;
use warnings;
use Data::Compare qw(Compare);
our $VERSION = '1.04';
sub _compare_object_and_object {
return $_[0] eq $_[1] ? 1 : 0;
}
sub _com
pare($_[0], ${$_[1]});
}
[
['JSON::PP::Boolean', \&_compare_object_and_object],
['JSON::PP::Boolean', '', \&_compare_object_and_scalar],
['JSON::XS::Boolean', \&_c
ar],
['JSON::backportPP::Boolean', \&_compare_object_and_object],
['JSON::backportPP::Boolean', '', \&_compare_object_and_scalar],
];
__END__
=head1 NAME
Data::Compare::Plugins::JSON - Plugi
package JSON::RPC::Spec::Common;
use Moo::Role;
use Carp ();
use JSON::MaybeXS qw(JSON);
has coder => (
is => 'lazy',
isa => sub {
my $self = shift;
$self->can('encode') or C
},
);
has [qw(_callback_key _jsonrpc)] => (is => 'lazy');
has [qw(_id _is_notification)] => (is => 'rw');
use namespace::clean;
sub _build_coder {
JSON->new->utf8;
}
sub _build__callbac
k_key {
'_callback';
}
sub _build__jsonrpc {
'2.0';
}
sub _error {
my ($self, $error) = @_;
return +{
jsonrpc => $self->_jsonrpc,
error => $error,
id =
package JSON::RPC::Spec;
use Moo;
use Carp ();
use version; our $VERSION = version->declare("v1.0.7");
use Try::Tiny;
use Router::Simple;
use JSON::RPC::Spec::Procedure;
use JSON::RPC::Spec::Client;
w
ith qw(
JSON::RPC::Spec::Common
);
use constant DEBUG => $ENV{PERL_JSON_RPC_SPEC_DEBUG} || 0;
has router => (
is => 'lazy',
isa => sub {
my $self = shift;
$self->can('matc
;
}
sub _build__procedure {
JSON::RPC::Spec::Procedure->new(router => shift->router);
}
sub _build__client {
JSON::RPC::Spec::Client->new;
}
sub _parse_json {
my ($self, $extra_args) =
package ThaiSchema::JSON;
use strict;
use warnings;
use utf8;
use ThaiSchema;
use Encode ();
# Licensed under the Artistic 2.0 license.
# See http://www.perlfoundation.org/artistic_license_2_0
.
# This module is based on JSON::Tiny 0.22
my $FALSE = \0;
my $TRUE = \1;
sub ddf {
require Data::Dumper;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
# Escaped specia
# Leading whitespace
m/\G$WHITESPACE_RE/gc;
# Context
my $context = 'Malformed JSON: ' . shift;
if (m/\G\z/gc) { $context .= ' before end of data' }
else {
my @lines
package MojoMojo::Controller::JSON;
use strict;
use parent 'Catalyst::Controller';
=head1 NAME
MojoMojo::Controller::JSON - Various functions that return JSON data.
=head1 SYNOPSIS
This is the Mo
jo for various functions that return JSON data.
=head1 DESCRIPTION
This controller dispatches various JSON data to AJAX methods in MojoMojo.
These methods will be called indirectly through JavaScrip
t functions.
=head1 ACTIONS
=head2 tagsearch (json/tagsearch)
Backend which handles jQuery autocomplete requests for tag.
=cut
sub tagsearch : Local {
my ($self, $c) = @_;
my $query = $c->r
rypt::OpenSSL::RSA ();
use MIME::Base64 ();
use Mojar::ClassShare 'have';
use Mojo::JSON 'encode_json', 'decode_json';
# Attributes
# JWT Header
has typ => 'JWT';
has alg => 'RS256';
# JWT Claim Se
::encode_base64url(encode_json $hashref);
}
sub demogrify {
my ($self, $safestring) = @_;
return {} unless defined $safestring && length $safestring;
return decode_json(MIME::Base64::decode_bas
e64url($safestring));
}
package Mojo::JSON;
# Need json keys to be sorted => s/keys/sort keys/
no warnings 'redefine';
sub _encode_object {
my $object = shift;
my @pairs = map { _encode_string($_
package MojoMojo::View::JSON;
use parent qw( Catalyst::View::JSON );
__PACKAGE__->config->{expose_stash}='json';
=head1 NAME
MojoMojo::View::JSON - Catalyst View
=head1 DESCRIPTION
Catalyst View
K = qw(
encode_json decode_json
json_true json_false
json_null
);
sub create_from_json {
my $json = shift;
my $class = shift;
my $opts = decode_json($json);
return unde
de_json { return Crypt::Keyczar::Util::JSON::encode(@_); }
sub decode_json { return Crypt::Keyczar::Util::JSON::decode(@_); }
sub json_true { return Crypt::Keyczar::Util::JSON::true(); }
sub json_fa
lse { return Crypt::Keyczar::Util::JSON::false(); }
sub json_null { return Crypt::Keyczar::Util::JSON::null(); }
sub encode {
my $src = shift;
return undef if !defined $src;
my $resu
package Text::JSON::Nibble;
=encoding utf8
=cut
use 5.006;
use strict;
use warnings;
use Data::Dumper;
=head1 NAME
Text::JSON::Nibble - Nibble complete JSON objects from buffers
=head1 VERSION
.01';
=head1 WARNING
This module should be used with caution, it will not handle 'badly formed' json well, its entire purpose was because I was experiencing
segfaults with Cpanel::XS's decode_prefi
rawling JSON extractor for plain TEXT, usable in both a 'streaming' or 'block' method, for when you need something that is not XS.
It is particularly handy for when you want to deal with JSON without
::ManifestReader::JSON;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: Extension of E::M::K::ManifestReader::JSON for Email::MIME::Kit::Bulk
$Email::MIME::Kit::Bulk::ManifestReader::JSON::VERSION = '0.0.
Reader::JSON';
sub read_manifest {
my ($self) = @_;
my $manifest = 'manifest.json';
if ($self->kit->has_language) {
$manifest = 'manifest.' . $self->kit->language . '.json';
}
my $json_ref = $self->kit->kit_reader->get_kit_entry($manifest);
my $content = JSON->new->decode($$json_ref);
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
=pod
=encoding
package JSON::Types::Flexible;
use strict;
use warnings;
use utf8;
our $VERSION = "0.03";
use JSON::Types ();
use List::MoreUtils qw/uniq/;
use Sub::Install;
use constant {
SUB_ALIAS => {
S()}) {
Sub::Install::install_sub({
code => SUB_ALIAS->{$_},
from => 'JSON::Types',
into => __PACKAGE__,
as => $_,
});
}
}
sub import {
from => 'JSON::Types',
into => $class,
as => $_,
});
}
}
1;
__END__
=encoding utf-8
=head1 NAME
JSON::Types::Flexible - Yet another L<JSON::Types> module
lugin::Parser::JSON;
$App::RoboBot::Plugin::Parser::JSON::VERSION = '4.004';
use v5.20;
use namespace::autoclean;
use Moose;
use MooseX::SetOnce;
use Data::Dumper;
use JSON;
use JSON::Path;
extend
App::RoboBot::Plugin';
=head1 parser.json
Exports a selection of functions for dealing with JSON structures.
=cut
has '+name' => (
default => 'Parser::JSON',
);
has '+description' => (
de
unctions for dealing with JSON structures.',
);
=head2 jq
=head3 Description
Performs a JSONPath query (similar in concept to XPath) against the given
JSON document. JSONPath is described at http:
aPOD::JSON;
our $VERSION = 'v0.5.0';
# ABSTRACT: The JSON Formatted MetaPOD Spec
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
sub implementation_class { return 'MetaPod::Format::JSON' }
-8
=head1 NAME
MetaPOD::JSON - The JSON Formatted MetaPOD Spec
=head1 VERSION
version v0.5.0
=head1 SYNOPSIS
This is mostly a documentation stub, documenting the C<JSON> Formatted version of Met
:Format::JSON>|MetaPOD::Format::JSON >>
=begin MetaPOD::JSON v1.1.0
{ "namespace":"MetaPOD::JSON" }
=end MetaPOD::JSON
=for Pod::Coverage implementation_class
=head1 Using MetaPOD::JSON in your
ned up in nmsg_input_close()
$nmsg_pcap->export_xs if $self;
$self;
}
sub is_file { }
sub is_json { }
sub is_sock { }
sub is_pres { }
sub is_pcap { }
###
package Net::Nmsg::XS::input_file;
use
;
###
package Net::Nmsg::XS::input_json;
use base qw( Net::Nmsg::XS::input );
use constant is_json => 1;
###
package Net::Nmsg::XS::input_sock;
use base qw( Net::Nmsg::XS::input );
use constan
Net::Nmsg::XS::output;
use base qw( Net::Nmsg::XS::base_xs );
use Carp;
sub is_file { }
sub is_json { }
sub is_sock { }
sub is_pres { }
sub is_cb { }
sub write {
my $self = shift;
for my $m
PerlIO::via::json;
use 5.008001;
use strict;
use warnings;
our $VERSION = '0.02';
use XML::XML2JSON;
### PerlIO::via interface
sub PUSHED {
bless {
obj => XML::XML2JSON->new()
}
$t = <$fh>;
(defined $t) ? $self->{obj}->xml2json($t) : undef;
}
sub WRITE {
my ($self, $buf, $fh) = @_;
if (print $fh $self->{obj}->json2xml($buf)) {
return length($buf);
}
::json - PerlIO layer to convert to and from JSON
=head1 SYNOPSIS
use PerlIO::via::json;
open my $fh, '<:via(json)', 'file.xml' or die "...: $!";
my $json = <$fh>;
open my $fh, '>:via(json)