umn->integer_unsigned(%args);
return $column;
}
method json(Str $name, Any %args) {
my $column = $self->column($name);
$column->json(%args);
return $column;
}
method morphs(Str $name) {
=head2 json
json(Str $name, Any %args) : Column
Registers a JSON column and returns the Command object set.
=over 4
=item json example #1
# given: synopsis
my $json = $self->json('metada
if ( !-e $configurationFile )
{
( $configurationFile = $0 ) =~ s/\.pl/\-config\.json/;
$log->error( "Não existe o arquivo de configuração...", { package => __PACKAGE__ } )
my $json_text = $self->{ json }->pretty( 1 )->canonical( 1 )->encode( $config->{ $configurationFile } );
open FH, ">", $configurationFile;
print FH $json_text;
urn join ' ', $self->type_integer($col), 'unsigned';
}
method type_json(Column $col) {
# return column type string
return 'json';
}
method type_string(Column $col) {
# return column type stri
# int unsigned
=back
=cut
=head2 type_json
type_json(Column $column) : Str
Returns the type expression for a json column.
=over 4
=item type_json example #1
# given: synopsis
use Doo
dle;
my $ddl = Doodle->new;
my $column = $ddl->table('users')->column('json');
$self->type_json($column);
# json
=back
=cut
=head2 type_string
type_string(Column $column) : Str
Retur
Log::Any qw/$log/;
use MarpaX::ESLIF 3.0.32;
my $ESLIF = MarpaX::ESLIF->new($log);
# ABSTRACT: JSON Data Interchange Format following ECMA-404 specification
our $VERSION = '0.014'; # VERSION
our
s{strict} ? _JSONStrict()->decode($input, %options) : _JSONRelaxed()->decode($input, %options)
}
sub encode {
my ($self, $input, %options) = @_;
return $options{strict} ? _JSONStrict()->enc
ns) : _JSONRelaxed()->encode($input, %options)
}
# -------------
# Private stubs
# -------------
sub _JSONStrict {
state $JSONStrict = MarpaX::ESLIF::JSON->new($ESLIF, 1);
return $JSONStrict
$$self->_api_exec($$self->_agent_endpoint."/check/register", 'PUT', %args, _content => $check->to_json);
return;
}
sub check_deregister {
my ($self, $check_id, %args) = @_;
croak 'usage:
lf->_api_exec($$self->_agent_endpoint."/service/register", 'PUT', %args, _content => $service->to_json);
return;
}
sub service_deregister {
my ($self, $service_id, %args) = @_;
croak 'usa
sul
use namespace::autoclean;
use HTTP::Tiny 0.014;
use URI::Escape qw(uri_escape);
use JSON::MaybeXS qw(JSON);
use Hash::MultiValue;
use Try::Tiny;
use Carp qw(croak);
use Moo;
use Type::Utils qw(
$trailing;
$url .= '?'.$self->_http->www_form_urlencode(\%args) if %args;
$url;
}
my $json = JSON->new->utf8->allow_nonref;
sub _prep_request {
my $callback = pop @_;
my ($self, $pat
gs,
);
}
sub _prep_response {
my ($self, $resp, %args) = @_;
my $data;
$data = $json->decode($resp->content) if length $resp->content > 0;
my $meta = try { Consul::Meta->new(%{$
tr*'],
pos => 0,
completion => $complete_path,
},
);
my @drivers = qw(json yaml org);
$SPEC{loadorg} = {
v => 1.1,
summary => 'Load Org document',
description
d $acl;
$$self->_api_exec($$self->_acl_endpoint."/create", 'PUT', %args, _content => $acl->to_json(), sub{
Consul::API::ACL::Success->new($_[0])
});
}
sub update {
my ($self, $acl
d $acl;
$$self->_api_exec($$self->_acl_endpoint."/update", 'PUT', %args, _content => $acl->to_json());
}
sub destroy {
my ($self, $id, %args) = @_;
croak 'usage: $acl->destroy($id, [%args
amespace::autoclean;
use Moo;
use Types::Standard qw(Str ArrayRef Enum);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str );
has behavior => ( is => 'ro', isa => E
=> ( is => 'ro', isa => Str );
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
defined $self->lock_delay ? (
api_exec($$self->_session_endpoint."/create", 'PUT', %args, ($session ? (_content => $session->to_json) : ()), sub {
$_[0]->{ID}
});
}
sub destroy {
my ($self, $id, %args) = @_;
c
, or docker_container_id are set';
}
sub _to_json_hash { %{shift->_json_hash} }
has _json_hash => ( is => 'lazy', isa => HashRef[Str] );
sub _build__json_hash {
my ($self) = @_;
{
Nam
qw(Str);
use JSON::MaybeXS;
has script => ( is => 'ro', isa => Str, required => 1 );
has interval => ( is => 'ro', isa => Str, required => 1 );
sub to_json { shift->_json }
has _json => ( is => '
lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
$self->_to_json_hash,
Script => $self->script,
Interval => $self->interval,
});
}
with qw(
'0.027';
use namespace::autoclean;
use Moo;
use Types::Standard qw(Str);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str );
has id => ( is
=> ( is => 'ro', isa => Str );
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
defined $self->name ? (
that folder for this to work though.
=cut
package LabKey::Query;
use warnings;
use strict;
use JSON;
use Data::Dumper;
use FileHandle;
use File::Spec;
use File::HomeDir;
use Carp;
# Force all SSL
x{debug};
my $json_obj = JSON->new->utf8->encode($data);
my $req = POST $url;
$req->content_length(length($json_obj));
$req->content_type('application/json');
$req->content($json_obj);
$req->a
oded_content);
}
my $response_json = JSON->new->utf8->decode( $response->content )
|| croak("ERROR: Unable to decode JSON.\n$url\n");
return $response_json;
}
sub _createUserAgent {
my
rbose',
handler=>sub {$opts->{verbose}=1},
},
json => {
getopt=>'json',
handler=>sub {$opts->{fmt}='json-pretty'},
},
};
sub _help_cmd {
require Perinci::Cm
name},
meta => $args{meta},
common_opts => $common_opts,
per_arg_json => 1,
);
print $res->[2];
}
sub _run_cmd {
require Perinci::Result::Format;
requ
argv},
meta => $args{meta},
check_required_args => 0,
per_arg_json => 1,
common_opts => $common_opts,
);
if ($res->[0] == 501) {
= version->declare('v0.0.5');
use App::unbelievable::Util;
use File::Slurp;
use File::Spec;
use JSON;
use Plack::Builder;
use Syntax::Highlight::Engine::Kate;
use Syntax::Highlight::Engine::Kate::Al
my @errors;
my $reader;
# Look for JSON frontmatter without separators (Hugo-style).
my $charcount;
eval {
$reader = JSON->new;
($frontmatter, $charcount) = $read
rkdown = substr $text, $charcount//0;
};
push @errors, "Could not read JSON: $@" if $@;
push @errors, "No JSON found" unless $charcount;
return ($frontmatter, $markdown) unless(@error
tion/ld+json">\E(.+?)</script>!s;
require JSON::MaybeXS;
eval { $ld = JSON::MaybeXS::decode_json($1) };
if ($@) {
log_error("Cannot parse linked data as JSON: $@");
package Mojolicious::Plugin::AWS;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::JSON 'encode_json';
use Mojo::AWS;
use Mojo::AWS::S3;
our $VERSION = '0.21';
sub register {
my ($self, $app, $co
secret_key => $args{secret_key}
);
## FIXME: MessageStructure 'json' and an encode_json Message needs
## FIXME: to be parameterized
my $tx = $aws->sign
e},
url => $args{url},
headers => {'Accept' => 'application/json'},
signed_headers =>
{'Content-Type' => 'application/x-www-form
pace::autoclean;
use Moo;
use Types::Standard qw(Str Int Bool ArrayRef);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str, required => 1 );
has id
&& !$C) || (!$A && !$B && $C)
}
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
Name => $self->name,
w($VERSION $ucl_schema_error);
use strict;
use warnings;
use base qw(Exporter);
use bytes ();
use JSON::PP::Boolean;
use XSLoader;
BEGIN {
$VERSION = '0.05';
XSLoader::load( 'Config::UCL', $VE
gs for libucl
=head1 SYNOPSIS
use Config::UCL;
use JSON::PP qw(to_json);
my $hash = ucl_load("key1 : val1");
say to_json $hash; # {"key1":"val1"}
my $text = ucl_dump($hash);
say $text; # key1 = "val1";
# libucl-0.8.1/tests/schema/required.json
my $data1 = { foo => 1 };
my $data2 = { bar => 1 };
my $schema = {
properties => {
foo =>
L<The TestML Grammar|https://github.com/ingydotnet/testml-pgx>
=item * L<A JSON Grammar|https://github.com/ingydotnet/json-pgx>
=item * L<A CronTab Grammar|https://github.com/ingydotnet/crontab-pgx
et/testml-pm>
=item * L<Pegex JSON Parser for Perl|https://github.com/ingydotnet/pegex-json-pm>
=item * L<A JSONY Decoder Perl Module|https://github.com/ingydotnet/json-pgx>
=item * L<A CronTab Par