Group
Extension

Matches 35358

Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/json_or_str.pm ( view source; MetaCPAN )
package Sah::Schema::json_or_str;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.0
07'; # VERSION

our $schema = [any => {
    summary => 'A JSON-encoded data or string',
    'prefilters' => ['Str::try_decode_json'],
    description => <<'_',

You can use this schema if you want to 
ine
script as command-line argument or option, it will be tried to be JSON-decoded
first. If the string does not contain valid JSON, it will be left as-is as
string.

This schema is convenient on the 
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/hash_from_json.pm ( view source; MetaCPAN )
ckage Sah::Schema::hash_from_json;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.
007'; # VERSION

our $schema = [hash => {
    summary => 'Hash, coerced from JSON string',
    'prefilters' => ['JSON::decode_str'],
    description => <<'_',

You can use this schema if you want to a
 a JSON-encoded object
(hash). Data will not be valid if the string does not contain valid JSON.

Note that hash data is accepted, unlike the `json_str::hash` schema which only
accepts hash in JSON-en
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Data/Sah/Filter/perl/JSON/decode.pm ( view source; MetaCPAN )
ah::Filter::perl::JSON::decode;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VE
 1,
        summary => 'Decode from JSON',
        might_fail => 1,
        examples => [
            {value=>'', valid=>0, summary=>'Empty string is not valid JSON'},
            {value=>'null', filt
 summary=>'Invalid JSON, missing closing quote'},
            {value=>{}, valid=>0, summary=>'Will become something like "HASH(0x560142d4e5e8)" and fail because it is not valid JSON'},
            #{v
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/json_str.pm ( view source; MetaCPAN )
package Sah::Schema::json_str;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.007'
t contains valid JSON',
    'prefilters' => ['JSON::check_decode'],
    description => <<'_',

This schema can be used if you want to accept a string that contains valid JSON.
The JSON string will not
. a JSON-encoded array will not beome an
array) but you know that the string contains a valid JSON. Data will not be
valid if the string does not contain valid JSON.

See also related schema: `json_or
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/hash_from_json.pm ( view source; MetaCPAN )
## no critic: TestingAndDebugging::RequireStrict
package Sah::SchemaR::hash_from_json;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"hash",clset
 JSON-encoded object\n(hash). Data will not be valid if the string does not contain valid JSON.\n\nNote that hash data is accepted, unlike the `json_str::hash` schema which only\naccepts hash in JSON-
amples=>[{summary=>"Empty string is not a valid JSON",valid=>0,value=>""},{summary=>"Valid JSON but not a hash",valid=>0,value=>1},{summary=>"Valid JSON but not a hash",valid=>0,value=>"[]"},{summary=
FunctionalPerl ( P/PF/PFLANZE/FunctionalPerl-0.72.76.tar.gz, PFLANZE, 2023; MetaCPAN )
FunctionalPerl/lib/FP/JSON.pm ( view source; MetaCPAN )
e
# bundled with this file.
#

=head1 NAME

FP::JSON

=head1 SYNOPSIS

    use FP::JSON qw(to_json);

    my $settings = {
        output_format => "JSON", # or "Mint"
        auto_numbers  => 1,
    
 },
        # pretty => 1, # extra re-parsing step at the end
    };

    use FP::List;
    is to_json([10, list(20,30), {40=> "foo", bar=> 50}], $settings),
       '[
    10,
    [
    20,
    30
   
" : 50
       }
    ]
    ';

=head1 DESCRIPTION

Currently just provides `to_json` to turn some kinds of data into a
JSON or Mint language string. This module will need some work for more
serious use
WebService-DS-SOP-Auth-V1_1 ( D/DS/DSSYSTEM/WebService-DS-SOP-Auth-V1_1-0.05.tar.gz, DSSYSTEM, 2023; MetaCPAN )
WebService-DS-SOP-Auth-V1_1/lib/WebService/DS/SOP/Auth/V1_1/Request/PUT_JSON.pm ( view source; MetaCPAN )
package WebService::DS::SOP::Auth::V1_1::Request::PUT_JSON;
use strict;
use warnings;
use Carp ();
use JSON::XS qw(encode_json);
use HTTP::Request::Common qw(PUT);
use WebService::DS::SOP::Auth::V1_1:
nt = encode_json($params);
    my $sig = create_signature($content, $app_secret);

    my $req = PUT $uri, Content => $content;
    $req->headers->header('content-type' => 'application/json');
    $re
ice::DS::SOP::Auth::V1_1::Request::PUT_JSON

=head1 DESCRIPTION

To create a valid L<HTTP::Request> object for C<PUT> request with content type C<application/json>.

=head1 FUNCTIONS

=head2 $class->c
WebService-DS-SOP-Auth-V1_1 ( D/DS/DSSYSTEM/WebService-DS-SOP-Auth-V1_1-0.05.tar.gz, DSSYSTEM, 2023; MetaCPAN )
WebService-DS-SOP-Auth-V1_1/lib/WebService/DS/SOP/Auth/V1_1/Request/POST_JSON.pm ( view source; MetaCPAN )
package WebService::DS::SOP::Auth::V1_1::Request::POST_JSON;
use strict;
use warnings;
use Carp ();
use JSON::XS qw(encode_json);
use HTTP::Request::Common qw(POST);
use WebService::DS::SOP::Auth::V1_
t = encode_json($params);
    my $sig = create_signature($content, $app_secret);

    my $req = POST $uri, Content => $content;
    $req->headers->header('content-type' => 'application/json');
    $re
rvice::DS::SOP::Auth::V1_1::Request::POST_JSON

=head1 DESCRIPTION

To create a valid L<HTTP::Request> object for given C<POST> request parameters to send JSON data.

=head1 METHODS

=head2 $class->cr
JSON-Typist ( R/RJ/RJBS/JSON-Typist-0.008.tar.gz, RJBS, 2023; MetaCPAN )
JSON-Typist/lib/JSON/Typist/DataPrinter.pm ( view source; MetaCPAN )
use strict;
use warnings;
package JSON::Typist::DataPrinter 0.008;

# ABSTRACT: a helper for Data::Printer-ing JSON::Typist data

use Data::Printer use_prototypes => 0;
use Term::ANSIColor qw(colored)
 = 'ansi214';

use Sub::Exporter -setup => [ qw( jdump ) ];

#pod =head1 SYNOPSIS
#pod
#pod   use JSON::Typist::DataPrinter qw( jdump );
#pod
#pod   my $data = get_typed_data_from_your_code();
#pod
#p
},
          'JSON::PP::Boolean'       => sub { colored([$BOOL_COLOR], $_[0] ? 'true' : 'false') },
        }
      ],
    )
  );
}

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

JSON::Typist::Data
JSON-Typist ( R/RJ/RJBS/JSON-Typist-0.008.tar.gz, RJBS, 2023; MetaCPAN )
JSON-Typist/lib/JSON/Typist.pm ( view source; MetaCPAN )
ckage JSON::Typist 0.008;
# ABSTRACT: replace mushy strings and numbers with rigidly typed replacements

#pod =head1 OVERVIEW
#pod
#pod JSON is super useful and everybody loves it.  Woo!  Go JSON!  Go
need to know.  You might using JSON for interchange with a
#pod system that needs its types in its values.  JSON::Typist is meant for this
#pod problem.
#pod
#pod L<JSON> (in its many variant forms) a
t as the variables are
#pod used.  (That's just a weird-o Perl problem.)  JSON::Typist is meant to take the
#pod result of JSON-decoding I<immediately> before you use it for anything else.  It
#pod re
Mojolicious-Plugin-Notifications ( A/AK/AKRON/Mojolicious-Plugin-Notifications-1.08.tar.gz, AKRON, 2022; MetaCPAN )
Mojolicious-Plugin-Notifications/lib/Mojolicious/Plugin/Notifications/JSON.pm ( view source; MetaCPAN )
package Mojolicious::Plugin::Notifications::JSON;
use Mojo::Base 'Mojolicious::Plugin::Notifications::Engine';

# TODO:
#   Probably introduce a notify_json function

has key => 'notifications';

# No
my ($self, $c, $notify_array, $rule, $json, %param) = @_;

  my $key = $param{key} // $self->key;

  return $json unless @$notify_array;

  if (!$json || ref $json) {
    my @msgs;
    foreach (@$noti
-1]]);
      };
    };

    if (!$json) {
      return { $key => \@msgs }
    }

    # Obect is an array
    elsif (index(ref $json, 'ARRAY') >= 0) {
      push(@$json, { $key => \@msgs });
    }

   
File-Dir-Dumper ( S/SH/SHLOMIF/File-Dir-Dumper-0.6.6.tar.gz, SHLOMIF, 2022; MetaCPAN )
File-Dir-Dumper/lib/File/Dir/Dumper/Stream/JSON/Writer.pm ( view source; MetaCPAN )
kage File::Dir::Dumper::Stream::JSON::Writer;
$File::Dir::Dumper::Stream::JSON::Writer::VERSION = '0.6.6';
use 5.014;
use strict;
use warnings;

use parent 'Format::JSON::Stream::Writer';



1;    # E
:JSON::Writer - writer for a stream of JSON data.

=head1 VERSION

version 0.6.6

=head1 SYNOPSIS

    use File::Dir::Dumper::Stream::JSON::Writer ();

    my $writer = File::Dir::Dumper::Stream::JSON
File-Dir-Dumper ( S/SH/SHLOMIF/File-Dir-Dumper-0.6.6.tar.gz, SHLOMIF, 2022; MetaCPAN )
File-Dir-Dumper/lib/File/Dir/Dumper/Stream/JSON/Reader.pm ( view source; MetaCPAN )
kage File::Dir::Dumper::Stream::JSON::Reader;
$File::Dir::Dumper::Stream::JSON::Reader::VERSION = '0.6.6';
use 5.014;
use strict;
use warnings;

use parent 'Format::JSON::Stream::Reader';



1;    # E
JSON::Reader - reader for stream of JSON objects.

=head1 VERSION

version 0.6.6

=head1 SYNOPSIS

    use File::Dir::Dumper::Stream::JSON::Reader ();

    my $reader = File::Dir::Dumper::Stream::JSON
Data-Sah-Filter-perl-Str-try_decode_json ( P/PE/PERLANCAR/Data-Sah-Filter-perl-Str-try_decode_json-0.003.tar.gz, PERLANCAR, 2022; MetaCPAN )
Data-Sah-Filter-perl-Str-try_decode_json/lib/Data/Sah/Filter/perl/Str/try_decode_json.pm ( view source; MetaCPAN )
ry_decode_json;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-08-25'; # DATE
our $DIST = 'Data-Sah-Filter-perl-Str-try_decode_json'; # DIST

our $VERSION = '0.003'; # VERSION

sub meta {
    +{
        v => 1,
        summary => 'JSON-decode if we can, otherwise leave string as-is',
        examples => [
            {value=>undef, summary
};

    my $res = {};

    $res->{modules}{"JSON::PP"} //= 0;
    $res->{expr_filter} = join(
        "",
        "do { my \$decoded; eval { \$decoded = JSON::PP->new->allow_nonref->decode($dt); 1 }; 
Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/lib/Amon2/Plugin/Web/JSON.pm ( view source; MetaCPAN )
package Amon2::Plugin::Web::JSON;
use strict;
use warnings;
use JSON 2 qw/encode_json/;
use Amon2::Util ();

my $_JSON = JSON->new()->ascii(1);

my %_ESCAPE = (
    '+' => '\\u002b', # do not eval as 
) = @_;
    unless ($c->can('render_json')) {
        Amon2::Util::add_method($c, 'render_json', sub {
            my ($c, $stuff) = @_;

            # for IE7 JSON venularity.
            # see http:
//www.atmarkit.co.jp/fcoding/articles/webapp/05/webapp05a.html
            my $output = $_JSON->canonical( $conf->{canonical} ? 1 : 0 )->encode($stuff);
            $output =~ s!([+<>])!$_ESCAPE{$1}!g
JSON-XS-ByteString ( C/CI/CINDY/JSON-XS-ByteString-1.007.tar.gz, CINDY, 2022; MetaCPAN )
JSON-XS-ByteString/lib/JSON/XS/ByteString.pm ( view source; MetaCPAN )
ckage JSON::XS::ByteString;

use 5.008;
use strict;
use warnings;

require Exporter;

our @ISA = qw(Exporter);
our @EXPORT_OK = qw(encode_json encode_json_pretty encode_json_unblessed encode_json_unbl
essed_pretty decode_json decode_json_safe);
our $VERSION = 1.007000;

require XSLoader;
XSLoader::load('JSON::XS::ByteString', $VERSION);

=head1 NAME

JSON::XS::ByteString - A more predictable and co
entation for JSON

=head1 SYNOPSIS

    use JSON::XS::ByteString qw(encode_json encode_json_unblessed decode_json decode_json_safe);

    $json_string = encode_json($perl_data);
    $json_string_prett
cPanel-APIClient ( C/CP/CPANEL/cPanel-APIClient-0.10.tar.gz, CPANEL, 2022; MetaCPAN )
cPanel-APIClient/lib/cPanel/APIClient/Utils/JSON.pm ( view source; MetaCPAN )
package cPanel::APIClient::Utils::JSON;

# Copyright 2020 cPanel, L. L. C.
# All rights reserved.
# http://cpanel.net
#
# This is free software; you can redistribute it and/or modify it under the
# sa
erl itself. See L<perlartistic>.

use strict;
use warnings;

use JSON ();

my $json;

sub _json {
    return $json ||= JSON->new()->utf8(0);
}

sub decode {
    return _json()->decode( $_[0] );
}

1;
Format-JSON-Stream ( S/SH/SHLOMIF/Format-JSON-Stream-0.0.1.tar.gz, SHLOMIF, 2022; MetaCPAN )
Format-JSON-Stream/lib/Format/JSON/Stream/Reader.pm ( view source; MetaCPAN )
package Format::JSON::Stream::Reader;
$Format::JSON::Stream::Reader::VERSION = '0.0.1';
use strict;
use warnings;
use 5.014;

sub new
{
    my $class = shift;

    my $self = bless {}, $class;

    $s
elf->_init(@_);

    return $self;
}

use Carp ();

use JSON::MaybeXS qw(decode_json);
use Class::XSAccessor accessors => { _in => 'in' };


sub _init
{
    my $self = shift;
    my $args = shift;

  
  my $self = shift;

    if ( $self->_readline() ne "# JSON Stream by Shlomif - Version 0.2.0\n" )
    {
        Carp::confess "No header for JSON stream";
    }

    return;
}

sub fetch
{
    my $se
Format-JSON-Stream ( S/SH/SHLOMIF/Format-JSON-Stream-0.0.1.tar.gz, SHLOMIF, 2022; MetaCPAN )
Format-JSON-Stream/lib/Format/JSON/Stream/Writer.pm ( view source; MetaCPAN )
package Format::JSON::Stream::Writer;
$Format::JSON::Stream::Writer::VERSION = '0.0.1';
use strict;
use warnings;
use 5.014;

sub new
{
    my $class = shift;

    my $self = bless {}, $class;

    $s
elf->_init(@_);

    return $self;
}

use Carp ();

use JSON::MaybeXS ();
use Class::XSAccessor accessors => { _out => '_out' };


sub _init
{
    my $self = shift;
    my $args = shift;

    $self->_
= shift;

    $self->_print("# JSON Stream by Shlomif - Version 0.2.0");

    return;
}

sub put
{
    my $self  = shift;
    my $token = shift;

    $self->_print( JSON::MaybeXS->new( canonical => 1 
Format-JSON-Stream ( S/SH/SHLOMIF/Format-JSON-Stream-0.0.1.tar.gz, SHLOMIF, 2022; MetaCPAN )
Format-JSON-Stream/lib/Format/JSON/Stream.pm ( view source; MetaCPAN )
 Format::JSON::Stream;
$Format::JSON::Stream::VERSION = '0.0.1';
use 5.014;
use strict;
use warnings;

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

Format::JSON::Stream - a stream of JSON data.

=
t-JSON-Stream>

=item *

RT: CPAN's Bug Tracker

The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.

L<https://rt.cpan.org/Public/Dist/Display.html?Name=Format-JSON-
rmat-JSON-Stream>

=item *

CPAN Testers

The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.

L<http://www.cpantesters.org/distro/F/Format-JSON-Stre

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.