use strict;
use warnings;
package JSON::Schema::Modern::Result;
# vim: set ts=8 sts=2 sw=2 tw=100 et :
# ABSTRACT: Contains the result of a JSON Schema evaluation
our $VERSION = '0.623';
use 5.020;
::Common::Numeric 'PositiveInt';
use JSON::Schema::Modern::Annotation;
use JSON::Schema::Modern::Error;
use JSON::Schema::Modern::Utilities qw(true false);
use JSON::PP ();
use List::Util 1.45 'uniq';
id => (
is => 'ro',
isa => Bool|InstanceOf('JSON::PP::true')|InstanceOf('JSON::PP::false'),
coerce => sub { $_[0] ? true : false }, # might be JSON::PP::* or builtin::* booleans
lazy => 1,
d
#!/usr/bin/env perl
package MOP4Import::Base::CLI_JSON;
use strict;
use warnings;
use Carp ();
use constant DEBUG => $ENV{DEBUG_MOP4IMPORT};
BEGIN {
print STDERR "Using (file '" . __FILE__ . "')\n"
is help message", json_type => 'string']
, ['quiet' => doc => 'to be (somewhat) quiet', json_type => 'int']
, ['scalar' => doc => "evaluate methods in scalar context", json_type => 'bool']
['output' => default => 'ndjson'
, doc => "choose output serializer (ndjson/json/tsv/dump)"
, json_type => 'string'
]
, ['flatten'
, json_type => 'bool'
]
l::JSON_TYPE;
use strict;
use warnings;
use constant DEBUG => $ENV{DEBUG_MOP4IMPORT};
use MOP4Import::Util qw/globref define_constant terse_dump/;
use MOP4Import::Opts qw/Opts/;
use Cpanel::JSON::
XS::Type;
our %JSON_TYPES; # It is too early to hide this.
BEGIN {
my $CLS = 'Cpanel::JSON::XS::Type';
foreach my $origTypeName (qw(int float string bool null)) {
foreach my $suffix ('', '_
'';
my $typeName = $origTypeName . $suffix;
my $lowerName = "JSON_TYPE_".$typeName;
my $upperName = "JSON_TYPE_".uc($typeName);
my $value = $CLS->$upperName;
define_con
d_attr) );
use utf8;
=head1 NAME
Class::JSON_Object - Role for Class::JSON_Object
=head1 SYNOPSIS
use Object::Pad;
class Action :does(Class::JSON_Object) {
field $operation;
f
ield $arg;
}
# Create instance and load from JSON.
my $op = Action->new->load('{"operation":"move","arg":42}');
# Accessors are automatically provided.
say "Operation = ", $op->o
n the form of
JavaScript objects in JSON format. This class, actually a role, makes
it easy to define classes that construct Perl objects that correspond to
the JSON objects.
The intention is that th
uncompressedBytes;
}
package Config {
sub AUTOLOAD;
}
package Cpanel::JSON::XS {
sub DESTROY;
sub _from_json($;$$) ;
sub _to_json($;$) ;
sub allow_barekey;
sub allow_bignum;
sub allow_blessed;
sub al
d;
sub decode;
sub decode_json($;$$) ;
sub decode_prefix;
sub dupkeys_as_arrayref;
sub encode;
sub encode_json($;$) ;
sub escape_slash;
sub filter_json_object;
sub filter_json_single_key_object;
sub g
b PG_INTERVAL() ;
sub PG_INTERVALARRAY() ;
sub PG_JSON() ;
sub PG_JSONARRAY() ;
sub PG_JSONB() ;
sub PG_JSONBARRAY() ;
sub PG_JSONPATH() ;
sub PG_JSONPATHARRAY() ;
sub PG_LANGUAGE_HANDLER() ;
sub PG_L
RN');
my @path_issues = $linter->find_issues(pattern => qr/paths?/i);
# Validate against JSON Schema
my @schema_errors = $linter->validate_schema;
=head1 DESCRIPTION
C<OpenAPI::Linter>
nting for C<OpenAPI> specifications.
It checks both structural correctness against the official C<JSON> Schema and performs
additional linting for best practices and common issues.
The module support
cation version from the provided document.
=cut
use strict;
use warnings;
use JSON::Validator;
use JSON qw(decode_json);
use YAML::XS qw(LoadFile);
use File::Slurp qw(read_file);
=head1 METHODS
=h
r::Outlet::Common::IP::HTTP::JSON;
use strict;
use warnings;
use base qw{Power::Outlet::Common::IP::HTTP};
#use Data::Dumper qw{Dumper};
use JSON qw{encode_json decode_json};
our $VERSION = '0.50';
::HTTP::JSON - Power::Outlet base class for JSON power outlets
=head1 SYNOPSIS
use base qw{Power::Outlet::Common::IP::HTTP::JSON};
=head1 DESCRIPTION
Power::Outlet::Common::IP::HTTP::JSON is a p
d querying an JSON-based network attached power outlet.
=head1 USAGE
use base qw{Power::Outlet::Common::IP::HTTP::JSON};
=head1 PROPERTIES
=head1 METHODS
=head2 json_request
JSON HTTP request
e JSON::Relaxed::ErrorCodes;
use JSON::Relaxed::Parser; our $VERSION = $JSON::Relaxed::Parser::VERSION;
=head1 JSON::Relaxed::ErrorCodes -- Error messages
If the document cannot be parsed, JSON::R
cy mode, JSON::Relaxed returns an undefined
value instead and sets the following error indicators:
=over 4
=item * $JSON::Relaxed::err_id
A unique code for a specific error.
=item * $JSON::Relaxed
ieved using
the parser methods err_id() and err_msg().
Following is a list of all error codes in JSON::Relaxed:
=over 4
=item * C<missing-input>
No input was found. This can be caused by:
$pa
;
use utf8;
package JSON::Relaxed;
use JSON::Relaxed::Parser; our $VERSION = $JSON::Relaxed::Parser::VERSION;
=encoding UTF-8
=head1 NAME
JSON::Relaxed -- An extension of JSON that allows for bet
=head1 Relaxed JSON?
There's been increasing support for the idea of expanding JSON to improve
human-readability.
"Relaxed" JSON (RJSON) is a term that has been used to describe a
JSON-ish format tha
that JSON doesn't.
Most notably, RJSON allows the use of JavaScript-like comments and
eliminates the need to quote all keys and values.
An (official) specification can be found on
L<RelaxedJSON.org|h
use Object::Pad;
use utf8;
package JSON::Relaxed::Parser;
our $VERSION = "0.098";
class JSON::Relaxed::Parser;
# Instance data.
field $data :mutator; # RJSON string being parser
field @pretoks;
tandard.
# Strict true -> RJSON conformant.
# Strict false (default) -> RRJSON. Everything goes :).
field $strict :mutator :param = 0;
# Allow extra stuff after the JSON structure.
# Strict mode
input
if ( $booleans ) {
if ( ref($booleans) ne 'ARRAY' ) {
$booleans = [ $JSON::Boolean::false, $JSON::Boolean::true ];
}
}
else {
$booleans = [ 0, 1 ];
}
my $glue = 0;
--------------------------------------------------------
## Module Generic - ~/lib/Module/Generic/JSON.pm
## Version v0.2.2
## Copyright(c) 2025 DEGUEST Pte. Ltd.
## Author: Jacques Deguest <jack@degu
:Generic::JSON;
BEGIN
{
use v5.12.0;
use strict;
use warnings;
use parent qw( Module::Generic );
use vars qw( @EXPORT @EXPORT_OK $AUTOLOAD $DEBUG $VERSION );
use JSON ();
u
= qw( Module::Generic );
our @EXPORT = qw( from_json to_json encode_json decode_json );
our @EXPORT_OK = qw( new_json );
our %EXPORT_TAGS = ();
our $VERSION = 'v0.2.2';
};
NAME
Quiq::Json - Operationen auf JSON Code
=head1 BASE CLASS
L<Quiq::Object>
=cut
# -----------------------------------------------------------------------------
package Quiq::Json;
use base q
e JSON ();
# -----------------------------------------------------------------------------
=head1 METHODS
=head2 Klassenmethoden
=head3 pretty() - Verschönere JSON Code
=head4 Synopsis
$json
->pretty($file);
$json = $class->pretty($jsonIn);
=head4 Arguments
=over 4
=item $file
(String) Datei mit JSON Code, der verschönert werden soll
=item $jsonIn
(String) JSON Code, der verschö
Quiq::Json::Code - Erzeuge JSON-Code in Perl
=head1 BASE CLASS
L<Quiq::Hash>
=head1 SYNOPSIS
=head2 Klasse laden und Objekt instantiieren
use Quiq::Json::Code;
my $j = Quiq::Json::Code->
new;
=head2 JSON-Objekt via object()
$json = $j->object(
pi => 3.14159,
str => 'Hello world!',
bool => \'true',
obj => $j->object(
id => 4711,
name => '
],
},
min: undefined,
}
Bei der Methode $j->L<object|"object() - Erzeuge Code für JSON-Objekt">()
=over 2
=item *
bleibt die Reihenfolge der Schlüssel/Wert-Paare erhalten
=item *
###############################################################
#
# @file Json.pm
#
# @brief Eulerian Data Warehouse REST Json Parser Module definition.
#
# @author Thorillon Xavier:x.thorillon@euleri
EDW::Parser::JSON;
#
# Enforce compilor rules
#
use strict; use warnings;
#
# Inherited interface from API::Eulerian::EDW::Parser
#
use parent 'API::Eulerian::EDW::Parser';
#
#
#
use JSON::Streaming::
class.
# @param $path - File Path.
# @param $uuid - Request UUID.
#
# @return API::Eulerian::EDW::Json Parser.
#
sub new
{
my ( $class, $path, $uuid ) = @_;
my $self;
my $fd;
# Setup base cla
package Lemonldap::NG::Portal::Lib::Notifications::JSON;
use strict;
use Mouse;
use JSON qw(from_json);
use POSIX qw(strftime);
our $VERSION = '2.21.0';
no warnings 'redefine';
# Lemonldap::NG::Po
my $file ( values %$notifs ) {
my $json = eval { from_json( $file, { allow_nonref => 1 } ) };
$self->userLogger->warn(
"Bad JSON file: a notification for $uid was not done
@);
my $j = 0; # Notifications count
$json = [$json] unless ( ref $json eq 'ARRAY' );
LOOP: foreach my $notif ( @{$json} ) {
# Get the reference
my $r
otifications::JSON;
use strict;
use Mouse;
use JSON qw(from_json to_json);
our $VERSION = '2.19.0';
sub newNotification {
my ( $self, $jsonString, $defaultCond ) = @_;
my $json;
$defaul
tCond ||= '';
eval { $json = from_json( $jsonString, { allow_nonref => 1 } ) };
if ( my $err = $@ ) {
eval { $self->logger->error("Unable to decode JSON file: $err") };
return
0;
}
my @notifs;
$json = [$json] unless ( ref($json) eq 'ARRAY' );
foreach my $notif (@$json) {
my @data;
$notif->{reference} =~ s/_/-/g; # Remove underscores (#21
::Session::Serialize::JSON;
use strict;
use JSON qw(to_json from_json);
our $VERSION = '2.19.0';
sub serialize {
my $session = shift;
$session->{serialized} = to_json( $session->{data}, {
);
}
sub _unserialize {
my ( $serialized, $next ) = @_;
my $tmp;
eval { $tmp = from_json( $serialized, { allow_nonref => 1 } ) };
if ($@) {
eval {
require Storabl
Serialize::JSON - Use JSON to zip up data
=head1 SYNOPSIS
use Lemonldap::NG::Common::Apache::Session::Serialize::JSON;
$zipped = Lemonldap::NG::Common::Apache::Session::Serialize::JSON::serialize
package Dancer2::Serializer::JSON;
# ABSTRACT: Serializer for handling JSON data
$Dancer2::Serializer::JSON::VERSION = '2.0.1';
use Moo;
use JSON::MaybeXS ();
use Scalar::Util 'blessed';
with 'Dancer
cation/json'} );
# helpers
sub from_json { __PACKAGE__->deserialize(@_) }
sub to_json { __PACKAGE__->serialize(@_) }
sub decode_json {
my ( $entity ) = @_;
JSON::MaybeXS::decode_json($enti
ty);
}
sub encode_json {
my ( $entity ) = @_;
JSON::MaybeXS::encode_json($entity);
}
# class definition
sub serialize {
my ( $self, $entity, $options ) = @_;
my $config = blessed $
::DataModel::Schema::ResultAs::Json;
#----------------------------------------------------------------------
use warnings;
use strict;
use DBIx::DataModel::Carp;
use JSON::MaybeXS ();
use parent
odel::Schema::ResultAs';
use namespace::clean;
sub new {
my ($class, %json_options) = @_;
keys %json_options
or %json_options = ( pretty => 1,
allow_blessed
s \%json_options, $class;
}
sub get_result {
my ($self, $statement) = @_;
my $json_maker = JSON::MaybeXS->new(%$self);
my $json = $json_maker->encode($statement->all);
return $json;
}
package JSON::Syck;
use strict;
use Exporter;
use YAML::Syck ();
our $VERSION = '1.36';
our @EXPORT_OK = qw( Load Dump LoadFile DumpFile DumpInto );
our @ISA = qw/Exporter/;
*Load = \&YAML:
:Syck::LoadJSON;
*Dump = \&YAML::Syck::DumpJSON;
sub DumpFile {
my $file = shift;
if ( YAML::Syck::_is_glob($file) ) {
my $err = YAML::Syck::DumpJSONFile( $_[0], $file );
if (
open( my $fh, '>', $file ) or die "Cannot write to $file: $!";
my $err = YAML::Syck::DumpJSONFile( $_[0], $fh );
if ($err) {
$! = 0 + $err;
die "Error writing