script-that-produces-json | json2yaml
=head1 DESCRIPTION
This distributions provides the following command-line utilities related to
serialization:
=over
=item * L<check-json>
=item * L<check-ph
<json2json>
=item * L<json2perl>
=item * L<json2perlcolor>
=item * L<json2phpser>
=item * L<json2sereal>
=item * L<json2sexp>
=item * L<json2storable>
=item * L<json2yaml>
=item * L<perl2json>
* L<phpser2json>
=item * L<phpser2perl>
=item * L<phpser2perlcolor>
=item * L<phpser2sereal>
=item * L<phpser2sexp>
=item * L<phpser2storable>
=item * L<phpser2yaml>
=item * L<pp-json>
=item *
ecoder::VERSION = '0.94';
use parent 'Raisin::Encoder';
sub builtin {
{
json => 'Raisin::Encoder::JSON',
yaml => 'Raisin::Encoder::YAML',
form => 'Raisin::Encoder::Form',
my $dec = Raisin::Decoder->new;
$dec->register(xml => 'Some::XML::Parser');
$dec->for('json');
$dec->media_types_map_flat_hash;
=head1 DESCRIPTION
Provides an easy interface to use an
uiltin
Returns a list of encoders which are bundled with L<Raisin>.
They are: L<Raisin::Encoder::JSON>, L<Raisin::Encoder::YAML>.
=head1 AUTHOR
Artur Khabibullin
=head1 COPYRIGHT AND LICENSE
This
};
=head3 produces
Specifies the content types produced by C<resource>.
produces ['text', 'json'];
The argument is an array reference of strings corresponding to the
keys used by C<register_en
asked without an extension (C<json>, C<yaml>) or C<Accept> header
isn't specified the default format will be used.
Default value: C<YAML>.
api_default_format 'json';
See also L<Raisin/API-FORM
exists L<Raisin::Encoder::JSON>, L<Raisin::Encoder::YAML>,
and L<Raisin::Encoder::Text>, but you can always register your own
using L</register_encoder>.
api_format 'json';
See also L<Raisin/API
r::Tiny>.
<pm:Tree::Dump>.
<pm:Data::CSel> and its related modules: <pm:App::htmlsel>, <pm:App::jsonsel>,
<pm:App::orgsel>, <pm:App::podsel>, <pm:App::ppisel>, <pm:App::yamlsel>,
<pm:App::CSelUtils>
g::Parser::Tiny>.
L<Tree::Dump>.
L<Data::CSel> and its related modules: L<App::htmlsel>, L<App::jsonsel>,
L<App::orgsel>, L<App::podsel>, L<App::ppisel>, L<App::yamlsel>,
L<App::CSelUtils>.
=head1
CSel syntax
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
=item * L<App::jsonsel> - Select JSON elements using CSel (CSS-selector-like) syntax
Author: L<PERLANCAR|https://metacpan.org
e Signer::AWSv4::SES;
use Moo;
extends 'Signer::AWSv4';
use Types::Standard qw/Str/;
use JSON::MaybeXS qw//;
use MIME::Base64 qw//;
has '+expires' => (default => 0);
#has '+region' =>
ncoder'} >>. Occasionally the application will want to
change the format, for example to return a JSON error response from a
route that normally returns plain text. To do that, change
C<< env->{'rasin
e Signer::AWSv4::EKS;
use Moo;
extends 'Signer::AWSv4';
use Types::Standard qw/Str/;
use JSON::MaybeXS qw//;
use MIME::Base64 qw//;
has prefix => (is => 'ro', init_arg => undef, isa => S
elf->qstring_64;
});
has k8s_json => (is => 'ro', isa => Str, init_arg => undef, lazy => 1, default => sub {
my $self = shift;
JSON::MaybeXS::encode_json({
kind => 'ExecCredential',
ubernetes cluster (via Authorization header or kubectl --token)
=head2 k8s_json
This wraps the token in the appropiate JSON output for using the token as kubectl pluggable
authentication module
=h
aisin::Plugin';
use Carp 'croak';
use Data::Dumper;
use Digest::MD5 qw/md5_hex/;
use JSON::MaybeXS qw/encode_json/;
use List::Util qw/pairmap/;
use Scalar::Util qw(blessed);
my %DEFAULTS;
my %SETTIN
@content_types = $app->format
? $app->format
: qw(application/x-yaml application/json);
my $base_path = $req->base->as_string;
### Respect proxied requests
# A proxy ma
cation,
name => $p->name,
required => $p->required ? JSON::MaybeXS::true : JSON::MaybeXS::false,
%$ptype,
);
$param{default} = $p->default
ort.h"
#include "const-c.inc"
#include <pthread.h>
#include <unistd.h>
#include <td/telegram/td_json_client.h>
typedef struct {
int id;
} client_t;
pthread_mutex_t log_mutex;
char * log_buffer
_t) + message_len + 1;
pthread_mutex_unlock(&log_mutex);
}
MODULE = Telegram::JsonAPI PACKAGE = Telegram::JsonAPI
INCLUDE: const-xs.inc
void
td_create_client_id()
PPCODE:
dSP;
my %json_map = (
operational_status => \&__encode_operational_status,
);
sub TO_JSON {
my ( $self ) = @_;
return $self->__to_json(
\%json_map,
$self->SUPER::TO_JSON(),
);
dern::Perl;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use AnyEvent::HTTP::MultiGet;
use JSON qw();
use Data::Dumper;
use Carp qw(croak);
use MIME::Base64 qw();
use URI::Escape;
use HTTP::Req
$self, $path, @args ) = @_;
my $str = $self->base_url . $path . '?';
push @args, 'output', 'JSON';
my $count = 0;
while ( my ( $key, $value ) = splice @args, 0, 2 ) {
if ( $count++ == 0
::Basename qw( dirname );
use File::Slurper qw( read_binary write_binary );
use Cpanel::JSON::XS qw( decode_json );
use Math::Int128 qw( MAX_UINT128 string_to_uint128 uint128 );
use MaxMind::DB::Write
tworks_with_data;
my $value = shift;
my $nodes
= decode_json( read_binary("$Dir/../source-data/$type-Test.json") );
for my $node (@$nodes) {
for my $network ( keys %$node
e lib::archive qw(
https://www.cpan.org/modules/by-module/JSON/JSON-PP-2.97001.tar.gz
CPAN://YAML-PP-0.007.tar.gz
);
use JSON::PP;
use YAML::PP;
or
use lib::archive '__DATA__';
_
subdirectory 'lib' applies from there. This means that e.g. for
'JSON-PP-2.97001.tar.gz' the modules will only be included from
'JSON-PP-2.97001/lib'.
You can use URLs for loading modules directly f
use lib::archive 'https://www.cpan.org/modules/by-module/JSON/JSON-PP-2.97001.tar.gz';
or use a shortcut like:
use lib::archive 'CPAN://JSON-PP-2.97001.tar.gz';
which will do exactly the same thi
nsions
Hash-ref of L<GraphQL::Type::Library/JSONable>s providing additional
information.
=cut
has extensions => (is => 'ro', isa => Optional[HashRef[JSONable]]);
=head1 METHODS
=head2 is
Is the
{
$self->message;
}
=head2 to_json
Converts to a JSON-able hash, in the format to send back as a member of
the C<errors> array in the results.
=cut
method to_json() :ReturnType(HashRef) {
+{ m
ll;
use GraphQL::MaybeTypeCheck;
use GraphQL::Language::Parser qw(parse);
use GraphQL::Error;
use JSON::MaybeXS;
use GraphQL::Debug qw(_debug);
use GraphQL::Introspection qw(
$SCHEMA_META_FIELD_DEF
- Execute GraphQL queries
=cut
our @EXPORT_OK = qw(
execute
);
our $VERSION = '0.02';
my $JSON = JSON::MaybeXS->new->allow_nonref;
use constant DEBUG => $ENV{GRAPHQL_DEBUG}; # "DEBUG and" gets op
decoded JSON object supplied by a
client. E.g. for this query:
query q($input: TestInputObject) {
fieldWithObjectInput(input: $input)
}
The C<$variable_values> will need to be a JSON object
package MojoX::JSONRPC2::HTTP;
use Mojo::Base -base;
use Carp;
our $VERSION = 'v2.0.3';
use Mojo::UserAgent;
use JSON::RPC2::Client;
use JSON::XS;
use Scalar::Util qw(weaken);
use constant REQUEST
lication/json';
has headers => sub { {} };
has ua => sub {
Mojo::UserAgent->new
->inactivity_timeout(0)
->request_timeout(REQUEST_TIMEOUT)
};
has _client => sub { JSON::RPC2::
($json_request, $call) = $self->_client->$func($method, @params);
my $tx; # will be set when in blocking mode
weaken(my $this = $self);
if ('GET' eq uc $self->method) {
my $json =
tabase;
use Mojo::Base -base;
use Carp qw(croak shortmess);
use DBI 'SQL_VARCHAR';
use Mojo::JSON 'to_json';
use Mojo::Promise;
use Mojo::SQLite::Results;
use Mojo::SQLite::Transaction;
use Mojo::Uti
ists $param->{json}) {
$sth->bind_param($i+1, to_json($param->{json}), SQL_VARCHAR);
} elsif (exists $param->{-json}) {
$sth->bind_param($i+1, to_json($param->{-json}), SQL_VARCH
AR);
} else {
croak qq{Unknown parameter hashref (no "type"/"value", "json" or "-json")};
}
} else {
$sth->bind_param($i+1, $param);
}
}
return $sth;
}
1;
=enco
L::Type::Enum;
use GraphQL::Type::Scalar qw($String $Boolean);
use GraphQL::Debug qw(_debug);
use JSON::MaybeXS;
=head1 NAME
GraphQL::Introspection - Perl implementation of GraphQL
=cut
our $VERSI
A_FIELD_DEF
$TYPE_NAME_META_FIELD_DEF
);
use constant DEBUG => $ENV{GRAPHQL_DEBUG};
my $JSON_noutf8 = JSON::MaybeXS->new->utf8(0)->allow_nonref;
=head1 SYNOPSIS
use GraphQL::Introspection qw($Q
'a placeholder for a string or numeric value. However an Enum value is ' .
'returned in a JSON response as a string.',
fields => {
name => { type => $String->non_null },
description
umentLocation JSONable
ErrorResult FieldsGot
);
use Type::Utils -all;
use Types::TypeTiny -all;
use Types::Standard -all;
use JSON::MaybeXS;
our $VERSION = '0.02';
my $JSON = JSON::MaybeXS->new
ype as
the C<type> (implemented with type L</ValuesMatchTypes>.
B<NB> this is a Perl value, not a JSON/GraphQL value.
=item description
Description.
=back
=cut
declare "FieldMapInput", as Map[
t[
line => Int,
column => Int,
];
=head2 JSONable
A value that will be JSON-able.
=cut
declare "JSONable",
as Any,
where { $JSON->encode($_); 1 };
=head2 ErrorResult
Hash-ref tha
GraphQL::Type::Library -all;
use GraphQL::Debug qw(_debug);
use Types::Standard -all;
use JSON::MaybeXS qw(JSON is_bool);
use Exporter 'import';
extends qw(GraphQL::Type);
with qw(
GraphQL::Role::In
ORT_OK = qw($Int $Float $String $Boolean $ID);
use constant DEBUG => $ENV{GRAPHQL_DEBUG};
my $JSON = JSON::MaybeXS->new->allow_nonref->canonical;
=head1 NAME
GraphQL::Type::Scalar - GraphQL scalar
_leave_undef(sub { !is_Bool($_[0]) and !is_bool($_[0]) and die "Not a Boolean.\n"; $_[0] ? JSON->true : JSON->false }),
parse_value => _leave_undef(sub { !is_Bool($_[0]) and !is_bool($_[0]) and die