package JSON::Schema::Generator::Handler::Object;
use strict;
use warnings;
use List::MoreUtils qw(uniq);
sub process {
my ($class, $object_type, $examples, $dispatch) = @_;
my $examples_by_pro
package JSON::Schema::Generator::Handler::Maybe::Lifted;
use strict;
use warnings;
sub process {
my($class, $maybe_type, $examples, $dispatch) = @_;
my $entity_examples = [ grep { $maybe_type->t
package JSON::Util;
=head1 NAME
JSON::Util - easy and portable encode/decode of JSON
=head1 SYNOPSIS
use JSON::Util;
$data = JSON::Util->decode('{"bar": "foo"}');
$data = JSON::Util->d
e.json');
JSON::Util->encode({ 'foo' => 'bar' }, 'someother.json');
$data = JSON::Util->decode(['..', 'folder', some.json]);
JSON::Util->encode([123,321], ['..', 'folder', someother.json]
);
print JSON::Util->encode([987,789]), "\n";
print JSON::Util->encode({987 => 789}), "\n";
my $json = JSON::Util->new(pretty => 0, convert_blessed => 1);
print $json->encode([ $obje
package Mojo::Log::JSON::LogStash;
use Mojo::Base 'Mojo::Log::JSON';
use Time::HiRes qw/ gettimeofday /;
our $VERSION = '0.04';
has default_fields => sub {
{ '@version' => 1,
'@tim
ding utf-8
=head1 NAME
Mojo::Log::JSON::LogStash - Simple JSON logger to produce LogStash format logs
=head1 SYNOPSIS
package MyApp;
use Mojo::Log::JSON::LogStash;
sub startup {
fig.conf'
or die "can't run logstash-forwarder: $!";
my $logger = Mojo::Log::JSON::LogStash->new( handle => $handle );
$logger->default_fields->{foo} = "bar"; # add ex
package Mojo::Log::JSON;
use Mojo::Base 'Mojo::Log';
our $VERSION = '0.04';
has codec => sub {
require JSON::MaybeXS;
JSON::MaybeXS->new->indent(0)->utf8->canonical;
};
has include_level =
ncoding utf-8
=head1 NAME
Mojo::Log::JSON - Simple JSON logger
=head1 SYNOPSIS
use Mojo::Log::JSON;
# Log to STDERR
my $logger = Mojo::Log::JSON->new;
# Customize log file locati
on, minimum log level and default fields
my $logger = Mojo::Log::JSON->new( #
path => '/var/log/mojo.log',
level => 'warn',
default_fields => {
package JSON::Pointer::Context;
use 5.008_001;
use strict;
use warnings;
use Class::Accessor::Lite (
new => 0,
rw => [
qw/
pointer
tokens
pr
st_token});
}
1;
__END__
=head1 NAME
JSON::Pointer::Context - Internal context object to process JSON Pointer
=head1 VERSION
This document describes JSON::Pointer::Context version 0.07.
=head1
SYNOPSIS
=head1 DESCRIPTION
This module is internal only.
=head1 METHODS
=head2 new(%args) :JSON::Pointer::Context
=head2 begin($token)
=head2 next($target)
=head1 DEPENDENCIES
Perl 5.8.1 or l
package JSON::Pointer;
use 5.008_001;
use strict;
use warnings;
use B;
use Carp qw(croak);
use Clone qw(clone);
use JSON qw(encode_json decode_json);
use JSON::Pointer::Context;
use JSON::Pointer::E
xception qw(:all);
use JSON::Pointer::Syntax qw(is_array_numeric_index);
use URI::Escape qw(uri_unescape);
our $VERSION = '0.07';
sub traverse {
my ($class, $document, $pointer, $opts) = @_;
}
};
$pointer = uri_unescape($pointer);
my @tokens = JSON::Pointer::Syntax->tokenize($pointer);
my $context = JSON::Pointer::Context->new(+{
pointer => $pointer,
tok
package JSON::Pointer::Syntax;
use 5.008_001;
use strict;
use warnings;
use Exporter qw(import);
use JSON::Pointer::Context;
use JSON::Pointer::Exception qw(:all);
our $VERSION = '0.07';
our @EXPOR
_pointer eq "" || $pointer eq "") {
JSON::Pointer::Exception->throw(
code => ERROR_INVALID_POINTER_SYNTAX,
context => JSON::Pointer::Context->new(
po
RRAY_INDEX$/ ? 1 : 0;
}
1;
__END__
=head1 NAME
JSON::Pointer::Syntax - JSON Pointer syntax functions
=head1 VERSION
This document describes JSON::Pointer::Syntax version 0.07.
=head1 SYNOPSIS
package JSON::Pointer::Exception;
use 5.008_001;
use strict;
use warnings;
use overload (
q|""| => "to_string"
);
use Carp ();
use Exporter qw(import);
our $VERSION = '0.07';
our @EXPORT_OK = q
ontext}{pointer});
}
1;
__END__
=head1 NAME
JSON::Pointer::Exception - Exception class for JSON::Pointer
=head1 VERSION
This document describes JSON::Pointer::Exception version 0.07
=head1 SYNOP
=head1 DESCRIPTION
=head1 METHODS
=head2 new(%opts) : JSON::Pointer::Exception
=head2 throw(%opts)
=head2 code :Int
=head2 context :JSON::Pointer::Context
=head2 to_string :Str
=head1 CONSTAN
package Dancer::Plugin::JSON::Schema;
our $VERSION = '0.001'; # VERSION
use strict;
use warnings;
use utf8;
use Dancer::Plugin;
use JSON ();
use JSON::Schema;
use JSON::Hyper;
use Dancer qw(:syntax)
;
my $schemas = {};
sub json_schema {
my ($self, $name) = plugin_args(@_);
my $cfg = plugin_setting;
if (not defined $name) {
if (keys %$cfg == 1) {
($name) = keys %$cfg;
} elsi
f (keys %$cfg) {
$name = "default";
} else {
die "No JSON Schemas are configured";
}
}
return $schemas->{$name} if $schemas->{$name};
my $options = $cfg->{$name} or die "Th
e Lego::From::PNG::View::JSON;
use strict;
use warnings;
BEGIN {
$Lego::From::PNG::VERSION = '0.04';
}
use parent qw(Lego::From::PNG::View);
use Data::Debug;
use JSON;
sub print {
my $se
gs = ref $_[0] eq 'HASH' ? %{$_[0]} : @_;
return JSON->new->utf8->pretty->encode( \%args );
}
=pod
=head1 NAME
Lego::From::PNG::View::JSON - Format data returned from Lego::From::PNG
=head1 S
JSON'); # Data is returned as JSON
=head1 DESCRIPTION
Class to returned processed data in JSON format
=head1 USAGE
=head2 new
Usage : ->new()
Purpose : Returns Lego::From::PNG::View::JSON
package Tk::Tree::JSON;
# Tk::Tree::JSON - JSON tree widget
# Copyright (c) 2008-2015 Jos� Santos. All rights reserved.
# This program is free software. It can be redistributed and/or modified und
quire JSON;
require Tk::Derived;
$VERSION = '0.04';
@ISA = qw(Tk::Derived Tk::Tree);
}
Construct Tk::Widget 'JSON';
sub Tk::Widget::ScrolledJSON { shift->Scrolled('JSON' => @_) }
my $json_parse
r = undef; # singleton JSON parser
# ConfigSpecs default values
my $VALUE_MAX_LENGTH = 80;
sub Populate {
my ($myself, $args) = @_;
$myself->SUPER::Populate($args);
$myself->ConfigSpecs(
-array
package Dallycot::Value::JSON;
our $AUTHORITY = 'cpan:JSMITH';
# ABSTRACT: Manages a memory-based JSON object
use strict;
use warnings;
use utf8;
use parent 'Dallycot::Value::Any';
use experimenta
use Promises qw(deferred);
=head1 DESCRIPTION
A JSON value represents a collection of properties and values.
Long term, a JSON value will be a JSON-LD document that can be interpreted
as a set of t
package Search::OpenSearch::Response::JSON;
use Moose;
use Carp;
extends 'Search::OpenSearch::Response';
use JSON;
our $VERSION = '0.409';
sub stringify {
my $self = shift;
my $resp = $self
JSON->new->utf8->pretty(1)->encode($resp)
: encode_json($resp);
}
sub content_type { return 'application/json; charset=utf-8' }
1;
__END__
=head1 NAME
Search::OpenSearch::Response::JSON
- provide search results in JSON format
=head1 SYNOPSIS
use Search::OpenSearch;
my $engine = Search::OpenSearch->engine(
type => 'KSx',
index => [qw( path/to/index1 path/to/index2 )],
package Dallycot::JSON::LD;
our $AUTHORITY = 'cpan:JSMITH';
use Moose;
use utf8;
use Carp qw(croak);
use Promises qw(deferred);
use experimental qw(switch);
sub to_rdf {
my($self, $input, %opti
container_mapping($active_property) eq '@list') {
croak "List of lists detected in JSON-LD";
}
}
push @result, grep { defined } @xp;
}
if
package SWISH::Filters::JSON;
use strict;
use vars qw( $VERSION @ISA );
$VERSION = '0.191';
@ISA = ('SWISH::Filters::Base');
use Data::Dump qw( dump );
sub new {
my ($class) = @_;
my $sel
pplication/json!], }, $class;
return $self->use_modules( 'JSON', ['Search::Tools::XML' => '0.88'], );
}
sub filter {
my ( $self, $doc ) = @_;
# get the raw content
my $json = $doc->f
etch_doc_reference;
# convert to perl
my $perl = JSON::decode_json($$json);
# convert to XML
my $xml = Search::Tools::XML->perl_to_xml(
$perl,
{ root => 'doc'
package WWW::JSON::Role::Authentication::Header;
use Moo::Role;
requires 'authentication';
requires 'ua';
sub _validate_Header {
my ( $self, $auth ) = @_;
die "Required header string missing
package WWW::JSON;
use 5.008005;
use strict;
use warnings;
our $VERSION = "1.02";
use LWP::UserAgent;
use Moo;
use Try::Tiny;
use URI;
use WWW::JSON::Response;
use Safe::Isa;
use JSON::XS;
use HTTP::
ormat $_[0]"
unless ( $_[0] eq 'serialized' || $_[0] eq 'JSON' );
}
);
has json =>
( is => 'ro', default => sub { JSON::XS->new->utf8->allow_nonref } );
has content_type => ( is => 'r
0] ) eq 'CODE';
}
);
has ua_options => ( is => 'lazy', default => sub { +{} } );
with 'WWW::JSON::Role::Authentication';
my %METHOD_DISPATCH = (
GET => \&HTTP::Request::Common::GET,
P
package WWW::JSON::Role::Authentication::Basic;
use Moo::Role;
use MIME::Base64;
requires 'authentication';
requires 'ua';
sub _validate_Basic {
my ( $self, $auth ) = @_;
for (qw/username pa
package WWW::JSON::Response;
use strict;
use warnings;
use Moo;
use JSON::XS;
use Try::Tiny;
has http_response => (
is => 'ro',
required => 1,
handles => {
status_line => '
rl => 'base',
content => 'decoded_content',
},
);
has json => ( is => 'lazy', default => sub { JSON::XS->new } );
has response => ( is => 'lazy', builder => '_build_
return unless ($self->http_response->decoded_content);
my $decoded = try {
$self->json->decode( $self->http_response->decoded_content );
}
catch {
$self->_set_error("$_