iew::JSON;
use strict;
use warnings;
=head1 NAME
Catalyst::Helper::View::JSON - Helper for JSON Views
=head1 SYNOPSIS
script/create.pl view JSON JSON
=head1 DESCRIPTION
Helper for JSON View
use strict;
use base 'Catalyst::View::JSON';
=head1 NAME
[% class %] - Catalyst JSON View
=head1 SYNOPSIS
See L<[% app %]>
=head1 DESCRIPTION
Catalyst JSON View.
=head1 AUTHOR
[% author %]
=
package Catalyst::View::JSON;
use strict;
use warnings;
our $VERSION = '0.37';
use 5.008_001;
use base qw( Catalyst::View );
use Encode ();
use MRO::Compat;
use Catalyst::Exception;
__PACKAGE__->mk
_accessors(qw(
allow_callback callback_param expose_stash
encoding json_dumper no_x_json_header json_encoder_args
use_force_bom));
sub new {
my($class, $c, $arguments) = @_;
my $self =
=~ /^catalyst/;
# no longer supported
warn('json_driver is no longer supported'), next if $field eq 'json_driver';
if ($self->can($field)) {
$self->$fiel
package Dwarf::Plugin::JSON;
use Dwarf::Pragma;
use Dwarf::Util qw/encode_utf8 add_method/;
use JSON;
my %_ESCAPE = (
'+' => '\\u002b', # do not eval as UTF-7
'<' => '\\u003c', # do not eval as HTM
arf.json'} = JSON->new();
$c->{'dwarf.json'}->pretty($conf->{pretty});
$c->{'dwarf.json'}->convert_blessed($conf->{convert_blessed});
$c->{'dwarf.json'}->ascii($conf->{ascii});
$c->{'dwarf.json'}-
al});
add_method($c, json => sub {
my $self = shift;
if (@_ == 1) {
$self->{'dwarf.json'} = $_[0];
}
return $self->{'dwarf.json'};
});
add_method($c, decode_json => sub {
my ($self,
package Catmandu::Exporter::Breaker::Parser::json;
use Catmandu::Sane;
use Moo;
use Catmandu::Expander;
use Catmandu::Breaker;
use namespace::clean;
our $VERSION = '0.141';
has tags => (is => 'r
$value)
);
}
1;
}
1;
__END__
=head1 NAME
Catmandu::Exporter::Breaker::Parser::json - default handler
=head1 DESCRIPTION
This is the default L<Catmandu::Breaker> handler.
=cut
5.006;
package Template::Plugin::JSON; # git description: v0.07-6-g80fc733
# ABSTRACT: Adds a .json vmethod for all TT values.
use Moose;
use JSON::MaybeXS 'JSON';
use Carp qw/croak/;
extends qw
(
isa => "Object",
is => "ro",
weak_ref => 1,
);
has json_converter => (
isa => "Object",
is => "ro",
lazy_build => 1,
);
has json_args => (
isa => "HashRef",
is => "ro",
default => sub
JSON::PP/Cpanel::JSON::XS now";
}
$args = ref $args[0] ? $args[0] : {};
return { %$args, context => $c, json_args => $args };
}
sub _build_json_converter {
my $self = shift;
my $json = JSON(
package ServiceNow::JSON;
use Moose;
use REST::Client;
use MIME::Base64;
use JSON;
our $VERSION = 0.02;
has 'instance' => (
is => 'rw',
isa => 'Str',
);
has 'user' => (
is => 'rw',
, $table, $action, $json ) = @_;
my $api_version = "JSONv2";
$api_version = "JSON" if $self->legacy;
my $url = $table . ".do?$api_version&$action";
if( $json ) {
$self-
>client->POST( $url, to_json( $json ), { "Content-type" => 'application/json' } );
if( $self->client->responseCode != 200 ) {
print STDERR "ERROR!\n";
print STDERR $sel
package CloudDeploy::CommandLine::Json {
use MooseX::App;
use CloudDeploy::Utils;
use CloudDeploy::DeploymentCollection;
parameter deployment => (is => 'ro', isa => 'Str', required => 1);
package DBIx::Struct::JSON::Array;
use strict;
use warnings;
sub TIEARRAY {
bless [$_[1], $_[2], $_[3]], $_[0];
}
sub FETCHSIZE {
scalar @{$_[0][0]};
}
sub STORESIZE {
$_[0][1]{$_[0][2]
->[1]{$ob->[2]} = undef;
return splice(@{$ob->[0]}, $off, $len, @_);
}
package DBIx::Struct::JSON::Hash;
use strict;
use warnings;
sub TIEHASH {
bless [$_[1], $_[2], $_[3]], $_[0];
}
sub ST
ruct::JSON;
use strict;
use warnings;
use JSON;
sub factory {
my ($class, $value_ref, $update_hash, $hash_key) = @_;
my $self;
if (not ref $$value_ref) {
my $jv = from_json($$val
ict;
package HTML::FormFu::Constraint::JSON;
# ABSTRACT: Valid JSON string
$HTML::FormFu::Constraint::JSON::VERSION = '2.07';
use JSON::MaybeXS qw( decode_json );
use Moose;
extends 'HTML::FormFu::C
= decode_json($value);
return $self->not ? !$ok : $ok;
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
HTML::FormFu::Constraint::JSON - Valid JSON string
=head1 VERSION
version 2.07
=head1 DESCRIPTION
Checks for valid JSON string
=head1 SEE ALSO
Is a sub-class of, and inherits methods from L<HTML::FormFu::Constraint>
L<HTML::FormFu>
=head1 AUTHO
JSON;
#ABSTRACT: Plugin to add .json vmethod to TT values.
use strict;
use warnings;
our $VERSION = '2.99.4'; ##TRIAL VERSION
use Template::Plugin;
use base 'Template::Plugin';
use JSON;
sub json
{
my $self = shift;
my $o = shift;
return JSON->new->convert_blessed(1)->encode($o);
}
1;
# Local Variables:
# mode: cperl
# indent-tabs-mode: nil
# cperl-indent-level: 4
# cperl-inde
ME
App::Manoc::View::TT::Plugin::JSON - Plugin to add .json vmethod to TT values.
=head1 VERSION
version 2.99.4
=head1 DESCRIPTION
This plugin provides a C<.json> vmethod to all value types when
:JSON;
use strict;
use warnings;
our $VERSION = '2.99.4'; ##TRIAL VERSION
use base 'Catalyst::View::JSON';
use JSON qw();
__PACKAGE__->config( 'expose_stash' => 'json_data', );
sub encode_json
$c->response->status(403);
$c->detach();
return;
}
my $encoder = JSON::MaybeXS->new(
utf8 => 1,
allow_blessed => 1,
convert_blesse
::Manoc::View::JSON
=head1 VERSION
version 2.99.4
=head1 SYNOPSIS
sub list_js : Chained('object_list') : PathPart('js') : Args(0) {
my ( $self, $c ) = @_;
$c->stash( json_data => \@my_l
ataService::JSON
#
# This module is responsible for putting data responses into JSON format.
#
# Author: Michael McClennen
use strict;
package Web::DataService::Plugin::JSON;
use JSON;
use Encode
;
use parent 'Exporter';
our @EXPORT_OK = qw(json_list_value json_clean);
# emit_header ( request, field_list )
#
# Return the initial text of a JSON result.
sub emit_header {
my ($class, $
foreach my $key ( $request->datainfo_keys )
{
next unless $info->{$key};
my $value = json_clean($info->{$key});
$output .= qq{"$key":$value,\n};
}
$output .= '"parameters":
## no critic: ValuesAndExpressions::ProhibitCommaSeparatedStatements
package Perinci::WebScript::JSON;
our $DATE = '2018-11-22'; # DATE
our $VERSION = '0.002'; # VERSION
use 5.010001;
use strict;
u
die $res unless $res->[0] == 200;
my $meta = $res->[2];
# create PSGI app
require JSON::MaybeXS;
require Perinci::Sub::GetArgs::WebForm;
require Plack::Request;
my $app = s
;
[
$res->[0],
['Content-Type' => 'application/json; charset=UTF-8'],
[JSON::MaybeXS->new->allow_nonref(1)->encode($res->[2])],
],
};
# de
ackage JSON::Patch;
use 5.006;
use strict;
use warnings FATAL => 'all';
use parent 'Exporter';
use Carp qw(croak);
use Struct::Diff 0.96;
use Struct::Path 0.82 qw(path);
use Struct::Path::JsonPointe
;
=head1 NAME
JSON::Patch - JSON Patch (rfc6902) for perl structures
=begin html
<a href="https://travis-ci.org/mr-mixas/JSON-Patch.pm"><img src="https://travis-ci.org/mr-mixas/JSON-Patch.pm.svg?b
-mixas/JSON-Patch.pm?branch=master'><img src='https://coveralls.io/repos/github/mr-mixas/JSON-Patch.pm/badge.svg?branch=master' alt='Coverage Status'/></a>
<a href="https://badge.fury.io/pl/JSON-Patch
package Data::Context::Loader::File::JSON;
# Created on: 2013-10-29 17:34:35
# Create by: Ivan Wills
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$
use Moose;
use version;
us
JSON::XS;
our $VERSION = version->new('0.3');
extends 'Data::Context::Loader::File';
has '+module' => (
default => 'JSON::XS',
);
sub loader {
my ($self, $file) = @_;
return JSON:
JSON - <One-line description of module's purpose>
=head1 VERSION
This documentation refers to Data::Context::Loader::File::JSON version 0.3
=head1 SYNOPSIS
use Data::Context::Loader::File::JSON
use warnings;
package WWW::Shopify::Liquid::Filter::JSON; use base 'WWW::Shopify::Liquid::Filter';
use JSON qw(encode_json decode_json from_json);
use Scalar::Util qw(blessed isweak);
use Clone qw(c
er as well.
if (defined $_[2] && !ref($_[2]) && length($_[2]) >= 2) {
my $object = eval { from_json($_[2]) };
return $object if !$@;
}
my $object = $_[2] ? (blessed($_[2]) && $_[2]->isa('WWW::S
pify::Model::Item') ? WWW::Shopify::Liquid->liquify_item($_[2]) : walk_data(clone($_[2]))) : $_[2];
return defined $object && ref($object) ? JSON->new->allow_blessed(1)->encode($object) : '{}';
}
1;
package JSON::API::Error;
# ABSTRACT: JSON API-style error objects
use Moo;
use overload bool => sub {1}, '""' => \&to_string;
use Types::Standard qw/Str HashRef/;
our $VERSION = '0.01';
has code
}
sub TO_JSON {
my $self = shift;
my $json = {};
for (qw/code detail id links meta source status title/) {
$json->{$_} = $self->$_ if $self->$_;
}
return $json;
}
1;
__
E
JSON::API::Error - JSON API-style error objects
=head1 SYNOPSIS
use JSON::API::Error;
use Mojo::JSON qw/encode_json/;
# A JSON API error representing bad submission data
my $err = JSON::
package Regexp::Pattern::JSON;
our $DATE = '2018-09-12'; # DATE
our $VERSION = '0.004'; # VERSION
use 5.010001;
our %RE;
$RE{number} = {
summary => 'Match a JSON number literal',
pat => qr
hes=>1},
{str=>'-1.23e2', matches=>1},
],
};
$RE{string} = {
summary => 'Match a JSON string literal',
pat => qr{(?:
"
(?:
[^\\"]+
|
\\ [0-7]{1,3}
g}{pat})
(?<NUMBER> $RE{number}{pat})
) # DEFINE
}xms;
$RE{array} = {
summary => 'Match a JSON array',
pat => qr{(?:
(?&ARRAY)
$define
)}xms,
examples => [
{str=>q([]),
sion::DBIC::Serializer::JSON;
=head1 NAME
Dancer2::Session::DBIC::Serializer::JSON
=head1 DESCRIPTION
Use L<JSON::MaybeXS> serialization for session storage.
=cut
use JSON::MaybeXS;
use Moo;
wit
to JSON.
=cut
sub serialize {
shift->serializer->encode(shift);
}
sub _build_serializer {
JSON::MaybeXS->new( shift->serialize_options );
}
=head2 deserialize $json
Deserialize C<$json> t
o Perl objects.
=cut
sub deserialize {
shift->deserializer->decode(shift);
}
sub _build_deserializer {
JSON::MaybeXS->new( shift->deserialize_options );
}
1;
package JSON::PP;
# JSON-2.0
use 5.005;
use strict;
use Exporter ();
BEGIN { @JSON::PP::ISA = ('Exporter') }
use overload ();
use JSON::PP::Boolean;
use Carp ();
#use Devel::Peek;
$JSON::PP::VER
SION = '2.97001';
@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
# instead of hash-access, i tried index-access for speed.
# but this method is not faster than what i expected. s
ndling is enabled?
# Helper module sets @JSON::PP::_properties.
if ( OLD_PERL ) {
my $helper = $] >= 5.006 ? 'JSON::PP::Compat5006' : 'JSON::PP::Compat5005';
eval qq| require $