package JSONSchema::Validator::JSONPointer;
# ABSTRACT: JSON Pointer with URI resolving
use strict;
use warnings;
use URI;
use Carp 'croak';
use Scalar::Util 'weaken';
use overload
'bool' => s
ub { $_[0]->value },
fallback => 1;
our @ISA = 'Exporter';
our @EXPORT_OK = qw(json_pointer);
sub json_pointer {
return __PACKAGE__;
}
sub append {
my ($class, $path, @values) = @_;
e, $validator) = @params{qw/scope value validator/};
croak 'JSONPointer: scope is required' unless defined $scope;
croak 'JSONPointer: validator is required' unless $validator;
weaken($v
kage JSONSchema::Validator;
# ABSTRACT: Validator for JSON Schema Draft4/Draft6/Draft7 and OpenAPI Specification 3.0
use strict;
use warnings;
use URI::file;
use Carp 'croak';
use Cwd;
use JSONSche
ma::Validator::Draft4;
use JSONSchema::Validator::Draft6;
use JSONSchema::Validator::Draft7;
use JSONSchema::Validator::OAS30;
use JSONSchema::Validator::Util qw(get_resource decode_content read_file)
ONS = {
JSONSchema::Validator::OAS30::ID => JSONSchema::Validator::OAS30::SPECIFICATION,
JSONSchema::Validator::Draft4::ID => JSONSchema::Validator::Draft4::SPECIFICATION,
JSONSchema::Vali
package JSONSchema::Validator::Draft4;
# ABSTRACT: Validator for JSON Schema Draft4
use strict;
use warnings;
use URI;
use Carp 'croak';
use JSONSchema::Validator::Error 'error';
use JSONSchema::Va
lidator::JSONPointer 'json_pointer';
use JSONSchema::Validator::Constraints::Draft4;
use JSONSchema::Validator::URIResolver;
use JSONSchema::Validator::Util qw(is_type);
use constant SPECIFICATION =>
'Draft4';
use constant ID => 'http://json-schema.org/draft-04/schema#';
use constant ID_FIELD => 'id';
sub create {
my ($class, %params) = @_;
croak 'schema is required' unless exists $para
package JSONSchema::Validator::Draft7;
# ABSTRACT: Validator for JSON Schema Draft7
use strict;
use warnings;
use JSONSchema::Validator::Constraints::Draft7;
use parent 'JSONSchema::Validator::Dra
=> 'http://json-schema.org/draft-07/schema#';
use constant ID_FIELD => '$id';
sub new {
my ($class, %params) = @_;
my $self = $class->create(%params);
my $constraints = JSONSchema::Val
d
=encoding UTF-8
=head1 NAME
JSONSchema::Validator::Draft7 - Validator for JSON Schema Draft7
=head1 VERSION
version 0.011
=head1 SYNOPSIS
$validator = JSONSchema::Validator::Draft7->new(s
package JSONSchema::Validator::Draft6;
# ABSTRACT: Validator for JSON Schema Draft6
use strict;
use warnings;
use JSONSchema::Validator::Constraints::Draft6;
use parent 'JSONSchema::Validator::Dra
=> 'http://json-schema.org/draft-06/schema#';
use constant ID_FIELD => '$id';
sub new {
my ($class, %params) = @_;
my $self = $class->create(%params);
my $constraints = JSONSchema::Val
d
=encoding UTF-8
=head1 NAME
JSONSchema::Validator::Draft6 - Validator for JSON Schema Draft6
=head1 VERSION
version 0.011
=head1 SYNOPSIS
$validator = JSONSchema::Validator::Draft6->new(s
package JSONSchema::Validator::Util;
# ABSTRACT: Useful functions
use strict;
use warnings;
use URI 1.00;
use File::Basename;
use B;
use Carp 'croak';
use Scalar::Util 'looks_like_number';
our @I
SA = 'Exporter';
our @EXPORT_OK = qw(
json_encode json_decode user_agent_get serialize unbool
round read_file is_type detect_type get_resource decode_content
data_section
);
use constant
IX_TO_MIME_TYPE => {
'yaml' => 'text/vnd.yaml',
'yml' => 'text/vnd.yaml',
'json' => 'application/json'
};
use constant TYPE_MAP => {
'array' => \&is_array,
'boolean' => \&is_bool,
tion the cost of
re-loading the code back to in-memory data, via eval-ing) compared to dumping to
JSON, YAML, Sereal, or other format. So you need to decide first whether this is
the appropriate route
t lets you load the serialized data without eval-ing them, thus
achieving the speed comparable to JSON::XS).
=head2 Is the output guaranteed to be single line dump?
No. Some things can still produce
erivate works in Data::Dump::*.
L<Data::Dumper> and its variants.
L<Data::Printer>.
L<YAML>, L<JSON>, L<Storable>, L<Sereal>, and other serialization formats.
=head1 AUTHOR
perlancar <perlancar@c
uses is to clean "unsafe" data,
e.g. clean a data structure so it can be encoded to JSON (see
L<Data::Clean::ForJSON>, which is a thin wrapper over this class).
As can be seen from the example, you s
age JSONSchema::Validator::Constraints::Draft4;
# ABSTRACT: JSON Schema Draft4 specification constraints
use strict;
use warnings;
use Scalar::Util 'weaken';
use URI;
use Carp 'croak';
use JSONSche
:Validator::Error 'error';
use JSONSchema::Validator::JSONPointer 'json_pointer';
use JSONSchema::Validator::Util qw(serialize unbool round is_type detect_type);
use JSONSchema::Validator::Format qw(
validate_int64
validate_float validate_double
validate_regex
validate_json_pointer validate_relative_json_pointer
validate_uri validate_uri_reference
validate_iri validate_iri_ref
age JSONSchema::Validator::Constraints::Draft6;
# ABSTRACT: JSON Schema Draft6 specification constraints
use strict;
use warnings;
use JSONSchema::Validator::JSONPointer 'json_pointer';
use JSONSch
ema::Validator::Error 'error';
use JSONSchema::Validator::Util qw(is_type serialize unbool);
use parent 'JSONSchema::Validator::Constraints::Draft4';
# params: $self, $value, $type, $strict
sub chec
($instance, 'object');
my $result = 1;
for my $p (keys %$instance) {
my $ipath = json_pointer->append($instance_path, $p);
my $r = $self->validator->_validate_schema($p, $prop
age JSONSchema::Validator::Constraints::OAS30;
# ABSTRACT: OpenAPI 3.0 specification constraints
use strict;
use warnings;
use URI;
use Carp 'croak';
use JSONSchema::Validator::JSONPointer 'json_po
inter';
use JSONSchema::Validator::Error 'error';
use JSONSchema::Validator::Util 'detect_type';
use parent 'JSONSchema::Validator::Constraints::Draft4';
sub type {
my ($self, $instance, $type,
= 1;
for my $i (0 .. $#{$instance}) {
my $item = $instance->[$i];
my $ipath = json_pointer->append($instance_path, $i);
my $r = $self->validator->_validate_schema($item, $i
Signature4> module.
=cut
use strict;
use warnings;
use AWS::Signature4;
use Digest::SHA ();
use JSON::PP ();
use MIME::Base64 ();
use POSIX 'strftime';
sub new {
my ($class, $credentials, $regi
$signing_key);
return $fields;
}
my $_JSON;
sub _encode_policy {
my $self = shift;
return MIME::Base64::encode_base64(
($_JSON ||= JSON::PP->new->utf8->canonical)->encode(@_),
ntials->from_ecs_container;
=cut
use strict;
use warnings;
use Carp;
use JSON::PP ();
use LWP::UserAgent;
my $JSON = JSON::PP->new->utf8->canonical;
sub new {
my ($class, $key, $secret, $sess
vice for credentials: ' . $cred->decoded_content unless $cred->is_success;
my $obj = eval { $JSON->decode($cred->decoded_content) };
croak "Invalid data returned from metadata service: $@" if
;
croak 'Error retrieving container credentials' unless $cred->is_success;
my $obj = eval { $JSON->decode($cred->decoded_content) };
croak "Invalid data returned: $@" if $@;
return __PACKAGE
->count }
##############################################################################
sub TO_JSON { $_[0]->to_array }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
File::KDBX::Iterator - KDBX
its pre-drained state. See L</CAVEATS>.
=head2 size
Alias for L</count>.
=for Pod::Coverage TO_JSON
=head1 CAVEATS
Some methods attempt to drain the iterator completely before returning. For obvi
ERSION = '0.006';
use Role::Tiny;
use Class::Method::Modifiers 'fresh';
use MIME::Base64 ();
use JSON::WebToken ();
use Digest::SHA ();
use Carp ();
# copy-paste from newer MIME::Base64 for older ve
$b64url_enc->( substr $digest, 0, length( $digest ) / 2 );
}
}
$self->add_token( id_token => JSON::WebToken->encode( $pay, $key, $alg, $head ) );
}
fresh add_id_token => \&fresh__add_id_token;
un
require File::KDBX::Entry;
return File::KDBX::Entry->wrap($entry, $KDBX{$self});
}
sub TO_JSON { +{%{$_[0]}} }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
File::KDBX::Object - A KDBX dat
an. Returns itself to allow method chaining.
=for Pod::Coverage STORABLE_freeze STORABLE_thaw TO_JSON
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website
L<https://gith
ate minion_workers set inbox =
json_set(inbox, '$[' || json_array_length(inbox) || ']', json(?))} .
(@$ids ? " where id in ($ids_in)" : ''),
{json => [$command, @$args]}, @$ids
)->
, ?, ?)},
{json => $args}, $options->{attempts} // 1, $options->{delay} // 0,
@$options{qw(expire expire)}, $options->{lax} ? 1 : 0, {json => $options->{notes} || {}},
{json => ($options->
->db->query(
qq{select id, args, attempts,
(select json_group_array(distinct child.id)
from minion_jobs as child, json_each(child.parents) as parent_id
where j.id = parent
d review on CPAN, I don't get CC'd them.
=head1 SEE ALSO
L<LWP::UserAgent>: L<HTTP::Request>: L<JSON>;
L<https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/
d review on CPAN, I don't get CC'd them.
=head1 SEE ALSO
L<LWP::UserAgent>: L<HTTP::Request>: L<JSON>;
L<https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/
#########################################################################################
sub TO_JSON { +{%{$_[0]}} }
1;
__END__
=pod
=encoding UTF-8
=for markdown [![Linux](https://github.com/c
dumper use it to scramble protected strings.
=for Pod::Coverage STORABLE_freeze STORABLE_thaw TO_JSON
=head1 RECIPES
=head2 Create a new database
my $kdbx = File::KDBX->new;
my $group = $