use 5.010001;
use strict;
use warnings;
use Log::ger;
use IPC::System::Options qw(system);
use JSON::MaybeXS;
use String::ShellQuote;
use Role::Tiny::With;
with 'App::cryp::Role::Masternode';
sub
d;
eval { $output_decoded = JSON::MaybeXS->new->decode($output) };
if ($@) {
log_error "Can't decode JSON output '$output', skipped";
use strict;
use Carp qw(croak carp);
use LWP;
use HTTP::Request::Common qw(POST);
use JSON qw( decode_json );
use vars qw($AUTOLOAD);
my %allowed = (
request_url => 'https://www.google.com/reca
>secret;
}
my $req = POST $self->request_url(), [%{$req_params}];
my $json = JSON->new->allow_nonref;
return $json->decode(
$ua->request($req)->decoded_content
);
}
sub DESTROY {}
1;
1,
coerce => sub {
my $serializer = shift or return undef;
require JSON::MaybeXS;
JSON::MaybeXS->new( ref $serializer ? %$serializer : () );
},
);
has login => (
i
sumed to be JSON
objects and will be automatically encoded/decoded using a L<JSON::MaybeXS>
serializer. If the value of C<serializer> is a hash, it'll be passed as
arguments to the L<JSON::MaybeXS> c
structures to JSON on the client side, you can do something like
var mySocket = new WebSocket(urlMySocket);
mySocket.sendJSON = function(message) {
return this.send(JSON.stringify(mes
not
C<undef>, all messages that are not L<AnyEvent::WebSocket::Message> objects
are assumed to be JSON and will be deserialized
before being passed to the handlers, and will be serialized after being
ide send_error ?
# TODO: add 'validate_schema'
# TODO: add 'strict_schema'
# TODO: make /swagger.json configurable
package Dancer::Plugin::Swagger;
our $AUTHORITY = 'cpan:YANICK';
# ABSTRACT: create
/^qr/ ? eval $_ : $_ }
@{ plugin_setting->{auto_discover_skip} || [
'/swagger.json', ( 'qr!' . $_[0]->ui_url . '!' ) x $_[0]->show_ui
] }
];
},
);
has validate_res
my $base_url = $plugin->ui_url;
get $base_url => sub { redirect $base_url . '/?url=/swagger.json' };
get $base_url . '/' => sub {
my $file = $plugin->ui_dir->child('index.html');
_ro';
use Carp;
use Hash::Merge;
use Clone 'clone';
use List::AllUtils qw/ first any none /;
use JSON;
use Class::Load qw/ load_class /;
has route => ( handles => [ 'pattern' ] );
has tags => ( pre
r ", ref $serializer
if none { $serializer->isa($_) } qw/ Dancer::Serializer::JSON Dancer::Serializer::YAML /;
$r->{examples}{$serializer->content_type} = $example;
definitions},
properties => { response => $schema },
};
my $result = load_class('JSON::Schema::AsType')->new( schema => $schema)->validate_explain({ response => $data });
return
unless @rels;
[200, "OK"];
}
$SPEC{dump} = {
v => 1.1,
summary => 'Dump Changes as JSON structure',
args => {
%common_args,
},
};
sub dump {
my %args = @_;
my (
K", $ch->preamble];
}
}
$SPEC{release} = {
v => 1.1,
summary => 'Return information (JSON object dump) of a specific release',
args => {
%common_args,
version => {
2 dump
Usage:
dump(%args) -> [$status_code, $reason, $payload, \%result_meta]
Dump Changes as JSON structure.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
options_txt, $name) = @_;
return {} if !$options_txt;
require JSON::XS;
my $options = eval { JSON::XS::decode_json($options_txt) };
my $error = $@;
if ($error && $self->verbo
olour ($name)>
Get the theme colour for C<$name>
=head3 C<parse_options ($options)>
Parses the JSON $options txt.
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
Lots of environment vari
age Mojolicious::Plugin::JSONRPC2;
use Mojo::Base 'Mojolicious::Plugin';
use Carp;
our $VERSION = 'v2.0.4';
use JSON::XS;
# to ensure callback runs on notification
use JSON::RPC2::Server 0.004000;
=> 200;
use constant HTTP_204 => 204;
use constant HTTP_415 => 415;
my $Type = 'application/json';
my %HEADERS = (
'Content-Type' => qr{\A\s*\Q$Type\E\s*(?:;|\z)}msi,
'Accept' => qr{(?:\
;
$app->helper(jsonrpc2_headers => sub { return %HEADERS });
$app->routes->add_shortcut(jsonrpc2 => sub { _shortcut('POST', @_) });
$app->routes->add_shortcut(jsonrpc2_get => sub { _
$symbols{$_} for @wontimplement;
};
do {
use Pod::Abstract;
use Mojo::Template;
use JSON qw( to_json );
my $mt = Mojo::Template->new;
my $pa = Pod::Abstract->load_file(
file(__FILE__)
JSON qw( from_json );
my \$functions = from_json(q[} . to_json(\%functions) . qq{]);
my \$constants = from_json(q[} . to_json(\@macros) . qq{] );
my \$pathtypes = from_json(q[} . to_json(
ght
# so return no transactions
return $self->block ? $self->block->{txs} : [];
}
sub TO_JSON($self) {
return '[Finance::Dogechain::Block](block_id => ' . $self->block_id . ')';
}
'to th
ailable by instance methods C<block_id()>, C<ua()>, and C<base_url()>.
=head2 block()
Returns a JSON data structure representing the block corresponding to the
C<block_id>, if that block is valid an
coinbase, for example.
=head2 TO_JSON()
Returns a string representation of this object (its class and C<block_id>) so that
you can serialize this object with L<JSON>.
=head1 COPYRIGHT & LICENSE
Co
ess} = Finance::Dogechain::Address->new( address => $item->{address} );
}
}
}
sub TO_JSON($self) {
return '[Finance::Dogechain::Transaction](tx_id => ' . $self->tx_id . ')';
}
'to th
able by instance methods C<tx_id()>, C<ua()>, and C<base_url()>.
=head2 transaction()
Returns a JSON data structure representing the transaction corresponding to the
C<tx_id>, if that transaction is
ing transaction outputs.
=head2 TO_JSON()
Returns a string representation of this object (its class and C<tx_id>) so that
you can serialize this object with L<JSON>.
=head1 COPYRIGHT & LICENSE
Cop
push and pop (thanks to Redis); provide
visibility into their contents; and store jobs as simple JSON hashes.
The Resque frontend tells you what workers are doing, what workers are not doing, what q
existing
architecture consensus) of the BGC composition. For this, this script exports in
TSV and JSON format data from all detected domain signatures.
This script, unlike the others, uses a FASTA f
n1_exploratory_domains
which will produce two_files in output: 'strain1_exploratory_domains.tsv' and
'strain1_exploratory_domains.json'.
This script does not take other option than C<--outfile>.
e writing code to autogenerate
L<OpenAPI|https://swagger.io/> server code. In OpenAPI, you have a JSON or
YAML document that specifies OpenAPI routes. Ignoring the rest of the
document, let's just loo
'200': # status code
description: A JSON array of user names
content:
application/json:
schema:
type: array
u, but sadly, it only writes client code
for Perl, not server code. So you want to read the above JSON document and
autogenerate code that looks like this:
package My::OpenAPI::Controller::Users;
push and pop (thanks to Redis); provide
visibility into their contents; and store jobs as simple JSON hashes.
The Resque frontend tells you what workers are doing, what workers are not doing, what q
que structures
$Resque::Encoder::VERSION = '0.42';
use Moose::Role;
use JSON;
has encoder => ( is => 'ro', default => sub { JSON->new->utf8 } );
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Resq
for encoding Resque structures
=head1 VERSION
version 0.42
=head1 ATTRIBUTES
=head2 encoder
JSON encoder by default.
=head1 AUTHOR
Diego Kuperman <diego@freekeylabs.com>
=head1 COPYRIGHT AND
'rw', isa => 'ArrayRef', default => sub {[]} );
coerce 'HashRef'
=> from 'Str'
=> via { JSON->new->utf8->decode($_) };
has payload => (
is => 'ro',
isa => 'HashRef',
coe
te.
When passed as a string this will be coerced using JSON decoder.
This is read-only.
=head1 METHODS
=head2 encode
String representation(JSON) to be used on the backend.
$job->encode();
=he
the queue where job had failed
class: the job class
error: the error string
args: a JSON representation of the job arguments
By default, all matching jobs will be deleted but the ones t
->{sass_functions}->{'foobar'} = \ &foobar;
# Compile string and get css output and source-map json
$sass->options->{source_map_file} = 'output.css.map';
($css, $stats) = $sass->compile('A { co
tem C<error_src>
=item C<error_file>
=item C<error_text>
=item C<error_message>
=item C<error_json>
=back
=back
=head1 OPTIONS
=over 4
=item C<output_style>
=over 4
=item C<SASS_STYLE_NESTE
t. See C<no_src_map_url>.
=item C<source_map_file_urls>
Render source entries in the source map json as file urls (`file:///`).
=item C<source_map_root>
A path (string) that is directly embedded i