Group
Extension

Matches 35358

Perinci-Sub-Property-result_postfilter ( P/PE/PERLANCAR/Perinci-Sub-Property-result_postfilter-0.10.tar.gz, PERLANCAR, 2016; MetaCPAN )
Perinci-Sub-Property-result_postfilter/lib/Perinci/Sub/Property/result_postfilter.pm ( view source; MetaCPAN )
 see L<Data::Clean::JSON>.

This property specifies postfilters for function result. Currently the focus of
this property is converting values that are unsafe when exporting to JSON/YAML.

Value: a ha
oder's facility, for example the L<JSON>
module can convert blessed object:

 use JSON 2;
 my $encoder = JSON->new->convert_blessed;
 {
     local *DateTime::TO_JSON = sub { $_[0]->ymd };
     print $
encoder->encode($doc);
 }

But this currently can't convert coderefs. JSON also can't handle circular
references, which neither this wrapper property nor the above way can work
around.

=head1 HOMEPAG
WWW-AUR ( J/JN/JNBEK/WWW-AUR-0.22.tar.gz, JNBEK, 2016; MetaCPAN )
WWW-AUR/lib/WWW/AUR/RPC.pm ( view source; MetaCPAN )
package WWW::AUR::RPC;

use warnings 'FATAL' => 'all';
use strict;

use JSON qw();
use Carp qw();

use WWW::AUR::URI qw( rpc_uri );
use WWW::AUR qw( _category_name _useragent );

my %_RENAME_FOR = ( '
          'LastModified' => 'mtime',
                   );

#---HELPER FUNCTION---
# Purpose: Map JSON package info keys to their new names...
sub _munge_result
{
    my ($info_ref) = @_;

    my %res
 info AUR RPC: ' . $resp->status_line
        unless $resp->is_success;

    my $json = JSON->new;
    my $data = $json->decode( $resp->content );

    if ( $data->{type} eq "error" ) {
        Carp::
WebService-SendGrid ( J/JL/JLLOYD/WebService-SendGrid-1.03.tar.gz, JLLOYD, 2016; MetaCPAN )
WebService-SendGrid/lib/WebService/SendGrid/Profile.pm ( view source; MetaCPAN )
d::Signatures;
use namespace::autoclean;

extends 'WebService::SendGrid';

use URI;
use Carp;
use JSON::XS;
use Mail::RFC822::Address qw(valid);

has 'first_name' => ( is => 'rw', isa => 'Str', requir
e_request('/api/profile.get.json', {});
  my $res = $self->_dispatch_request($req);
  return $self->_process_error($res) if $res->code != 100;
	my $content = ${ decode_json $res->content }[0];
	
	# it
e_request('/api/profile.set.json', \%data);
  my $res = $self->_dispatch_request($req);
	return $self->_process_error($res) if $res->code != 200;
	my $content = decode_json $res->content;
  
}

method
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Validator.pm ( view source; MetaCPAN )
ry
        throw_error
        throw_immediate
        formats
    /]
);
use Clone qw(clone);
use JSON;
use JSV::Keyword qw(:constants);
use JSV::Reference;
use JSV::Context;
use Module::Pluggable::Ob

        current_schema_pointer => "",
        schema_pointer_history => [],
        json                   => JSON->new->allow_nonref,
        loose_type             => $opts->{loose_type},
    );

 
alidator;
}

1;

__END__

=encoding utf-8

=head1 NAME

JSV::Validator - A perl implementation of JSON Schema (draft-04) validator

=head1 SYNOPSIS

  use feature qw(say);
  use JSV::Validator;

  JSV
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Context.pm ( view source; MetaCPAN )
ow_immediate
        enable_history
        enable_format
        formats
        history
        json
        loose_type
    /],
    ro  => [qw/
        errors
        current_type
        current_ke
        current_schema_pointer
        schema_pointer_history
    /],
);

use Carp qw(croak);
use JSON;
use JSV::Keyword qw(:constants);
use JSV::Util::Type qw(detect_instance_type detect_instance_typ
ance {
    my $self = shift;

    my $instance;
    if ( JSON::is_bool($self->current_instance) ) {
        if ( $self->current_instance == JSON::true ) {
            $instance = "true";
        }
   
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Reference.pm ( view source; MetaCPAN )
ge JSV::Reference;

use strict;
use warnings;

use Carp;
use Clone qw(clone);
use Data::Walk;
use JSON::Pointer;
use Scalar::Util qw(weaken);
use URI;
use URI::Split qw(uri_split uri_join);

my %memo;
e reference: uri = %s", $uri);
    }

    if ( $fragment ) {
        eval {
            $schema = JSON::Pointer->get($schema, $fragment, 1);
        };
        if (my $e = $@ ) {
            die sprin
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Util/Type.pm ( view source; MetaCPAN )
e Scalar::Util qw(blessed looks_like_number);
use JSON;

our @EXPORT_OK = (qw/
    detect_instance_type
    detect_instance_type_loose
    escape_json_pointer
/);

our %REF_TYPE_MAP = (
    HASH  => "
  if (!blessed $instance) {
            return $REF_TYPE_MAP{$ref_type};
        }
        elsif (JSON::is_bool($instance)) {
            return "boolean";
        }
        else {
            croak(s
$/;
            return "number_or_string";
        }
    }
    return $type_strict;
}

sub escape_json_pointer {
    my $property = shift;
    return unless defined $property;

    # according to http
WebService-Pingboard-REST ( R/RC/RCL/WebService-Pingboard-REST-0.002.tar.gz, RCL, 2016; MetaCPAN )
WebService-Pingboard-REST/lib/WebService/Salesforce/REST.pm ( view source; MetaCPAN )
oseX::WithCache;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
use HTTP::Message;
use JSON;
use Class::Date qw/gmdate/;
use POSIX; #strftime
use YAML qw/Dump LoadFile DumpFile/;
use Encode
g'   => HTTP::Message::decodable ); # Enable compression
    $h->header( 'Accept'	=> "application/json" );
    my $data = $self->request_from_api(
        headers     => $h,
        uri         => 'ht
     => "application/json" );
        $h->header( 'Accept-Encoding'   => HTTP::Message::decodable ); # Enable compression
        $h->header( 'Accept'	        => "application/json" );
        $h->head
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Keyword/Draft4/Enum.pm ( view source; MetaCPAN )
um;

use strict;
use warnings;
use parent qw(JSV::Keyword);

use JSV::Keyword qw(:constants);
use JSON;
use List::MoreUtils qw(firstidx);

sub instance_type() { INSTANCE_TYPE_ANY(); }
sub keyword() { 
>keyword_value($schema);
    my $instance_as_json = $context->json->encode($instance);
    my $matched_idx = firstidx { $instance_as_json eq $context->json->encode($_); } @$enum;

    if ($matched_idx
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Keyword/Draft4/Maximum.pm ( view source; MetaCPAN )
ackage JSV::Keyword::Draft4::Maximum;

use strict;
use warnings;
use parent qw(JSV::Keyword);
use JSON;

use JSV::Keyword qw(:constants);

sub instance_type() { INSTANCE_TYPE_NUMERIC(); }
sub keyword(
value($schema);
    my $exclusive_maximum = $class->keyword_value($schema, "exclusiveMaximum") || JSON::false;

    if ($exclusive_maximum) {
        if ($instance >= $maximum) {
            $context-
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV.pm ( view source; MetaCPAN )

our $VERSION = "0.08";

1;
__END__

=encoding utf-8

=head1 NAME

JSV - A perl implementation of JSON Schema (draft-04) validator

=head1 SYNOPSIS

=head1 DESCRIPTION

See e.g. L<JSV::Validator>

=he
Net-RackSpace-CloudServers ( M/MF/MFONTANI/Net-RackSpace-CloudServers-0.15.tar.gz, MFONTANI, 2016; MetaCPAN )
Net-RackSpace-CloudServers/lib/Net/RackSpace/CloudServers.pm ( view source; MetaCPAN )
oudServers::Limits;
use LWP::ConnCache::MaxKeepAliveRequests;
use LWP::UserAgent::Determined;
use JSON;
use YAML;
use Carp;

our $DEBUG = 0;

has 'user'    => (is => 'ro', isa => 'Str', required => 1)
s scalar grep { $response->code eq $_ } (200, 203);
    my @servers;
    my $hash_response = from_json($response->content);
    warn Dump($hash_response) if $DEBUG;

    # {"servers":[{"name":"test00"
ode
        unless scalar grep { $response->code eq $_ } (200, 203);
    my $hash_response = from_json($response->content);
    warn Dump($hash_response) if $DEBUG;

    confess 'response does not con
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Keyword/Draft4/Dependencies.pm ( view source; MetaCPAN )
ngs;
use parent qw(JSV::Keyword);

use JSV::Keyword qw(:constants);
use JSV::Util::Type qw(escape_json_pointer);
use List::Util qw(first);

sub instance_type() { INSTANCE_TYPE_OBJECT(); }
sub keyword(
 . "/" . escape_json_pointer( $property );
        local $context->{current_schema_pointer} =
            $context->{current_schema_pointer} . "/" . $class->keyword . "/" . escape_json_pointer( $prope
Catalyst-Controller-DirectoryDispatch ( A/AG/AGORMAN/Catalyst-Controller-DirectoryDispatch-1.03.tar.gz, AGORMAN, 2016; MetaCPAN )
Catalyst-Controller-DirectoryDispatch/lib/Catalyst/Controller/DirectoryDispatch.pm ( view source; MetaCPAN )
;
BEGIN { extends 'Catalyst::Controller' }

use JSON;
use Try::Tiny;
use namespace::autoclean;

__PACKAGE__->config(
    'default'   => 'application/json',
    'stash_key' => 'response',
    'map'    
   => {
        'application/x-www-form-urlencoded' => 'JSON',
        'application/json'                  => 'JSON',
    }
);

has 'root' => (
    is      => 'ro',
    isa     => 'Str',
    default =
e} = {
            "error"   => "Failed to open directory '$full_path'",
            "success" => JSON::false,
        };
        $c->detach('serialize');
    };

    my $regexp = $self->filter;
    @
Redmine-Fetch ( M/MO/MOVEAX/Redmine-Fetch-0.01.tar.gz, MOVEAX, 2016; MetaCPAN )
Redmine-Fetch/lib/Redmine/Fetch.pm ( view source; MetaCPAN )
rver} . '/' . $call . '.json' => $header => json => $payload );

        } elsif ( $mode eq 'delete' ) {

            $tx = $ua->delete( $config->{server} . '/' . $call . '.json' => $header );

      
l . '.json' => $header => json => $payload ); 

        } else {

            my $combined_payload = { %$payload, %$params };

            $tx = $ua->get( $config->{server} . '/' . $call . '.json' => 
bined_payload );
        }

        if ( my $res = $tx->success ) {
            $response = $res->json;
        } else {
            warn 'fail';
            p $tx->body;
            my $err = $tx->er
WebService-Ooyala ( V/VR/VROOM/WebService-Ooyala-0.03.tar.gz, VROOM, 2016; MetaCPAN )
WebService-Ooyala/lib/WebService/Ooyala.pm ( view source; MetaCPAN )
pe qw(uri_escape);
use LWP::UserAgent;
use Carp qw(croak);
use Digest::SHA qw(sha256_base64);
use JSON;

=head1 NAME

WebService::Ooyala - Perl interface to Ooyala's API, currently only read
operation
path, $body, $params) = @_;

	my $path = "/" . $self->{api_version} . "/" . $relative_path;

	my $json_body = {};

	my $url =
		$self->build_path_with_authentication_params($http_method, $path,
		$par
ailed to GET $full_url - " . $resp->status_line;
		}

		if ($resp->is_success) {
			return decode_json($resp->decoded_content);
		}
	} else {
		croak
			"Trying to call a method that is not implemente
Net-Amazon-EMR ( J/JJ/JJSCHUTZ/Net-Amazon-EMR-0.21.tar.gz, JJSCHUTZ, 2016; MetaCPAN )
Net-Amazon-EMR/lib/Net/Amazon/EMR/Role/AttrHash.pm ( view source; MetaCPAN )
             $n => $v;
              }
        } $self->meta->get_all_attributes
    };
}

sub TO_JSON {
    my ($self) = @_;
    return $self->as_hash;
}

1;

__END__

=head1 NAME

Net::Amazon::EMR::
WebService-SendGrid ( J/JL/JLLOYD/WebService-SendGrid-1.03.tar.gz, JLLOYD, 2016; MetaCPAN )
WebService-SendGrid/lib/WebService/SendGrid/Mail.pm ( view source; MetaCPAN )
d::Signatures;
use namespace::autoclean;

extends 'WebService::SendGrid';

use URI;
use Carp;
use JSON::XS;
use DateTime::Format::HTTP;

use Mail::RFC822::Address qw(valid);
subtype 'Email', as 'Str',
headers' => ( is => 'rw', isa => 'HashRef', required => 0 );
# A collection of key/value pairs in JSON format
has 'date' => ( is => 'rw', isa => 'Str', required => 1, default => sub {
  DateTime::Form
ate_request('/api/mail.send.json', \%data);
  my $res = $self->_dispatch_request($req);
	return $self->_process_error($res) if $res->code != 100;
	my $content = decode_json $res->content;
	
}

1;

__E
WebService-SendGrid ( J/JL/JLLOYD/WebService-SendGrid-1.03.tar.gz, JLLOYD, 2016; MetaCPAN )
WebService-SendGrid/lib/WebService/SendGrid.pm ( view source; MetaCPAN )
interface to the SendGrid email service
use Moose;
use MooseX::Method::Signatures;

use Carp;
use JSON::XS;
use WWW::Curl::Simple;
use HTTP::Request;

has 'user_agent' => (
  is => 'ro',
  isa => 'WWW
ofile.get.json') {
    my %profile = (
      username => 'jlloyd',
      email => 'jlloyd@cpan.org',
      website_access => 'true',
      active => 'true',
    );
    $content = encode_json( [ \%prof
ile ]);
  }
  else {
    $content = encode_json( { message => 'success' });
  }
  
  my $res = HTTP::Response->new;
  $res->code(100);
  $res->content( $content );
  return $res;
}

method _dispatch_r
JSV ( Z/ZI/ZIGOROU/JSV-0.08.tar.gz, ZIGOROU, 2016; MetaCPAN )
JSV/lib/JSV/Keyword/Draft4/Properties.pm ( view source; MetaCPAN )
V::Keyword);

use JSV::Keyword qw(:constants);
use JSV::Util::Type qw(detect_instance_type escape_json_pointer);

sub instance_type() { INSTANCE_TYPE_OBJECT(); }
sub keyword() { 'properties' }
sub add
nstance) {
        local $context->{current_pointer} = $context->{current_pointer} . "/" . escape_json_pointer( $property );

        if (exists $properties->{$property}) {
            local $context-
nt_schema_pointer} =
                $context->{current_schema_pointer} . "/properties/" . escape_json_pointer( $property );
            $context->validate($properties->{$property}, $instance->{$prope

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.