Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
update JSD2 and Mojolicious
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Jan 4, 2021
1 parent 7a808dc commit 9e2ec2d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cpanfile
Expand Up @@ -29,7 +29,7 @@ requires 'Email::Sender::Simple';
requires 'Email::Sender::Transport::SMTP';
requires 'Net::DNS'; # not used directly, but Email::Valid sometimes demands it
requires 'experimental', '0.020';
requires 'JSON::Schema::Draft201909', '0.019';
requires 'JSON::Schema::Draft201909', '0.020';
requires 'Email::Address::XS', '1.01';
requires 'YAML::PP';
requires 'next::XS';
Expand Down
38 changes: 19 additions & 19 deletions cpanfile.snapshot
Expand Up @@ -2283,22 +2283,22 @@ DISTRIBUTIONS
JSON::PP 2.27300
Scalar::Util 0
perl 5.006
JSON-Schema-Draft201909-0.019
pathname: E/ET/ETHER/JSON-Schema-Draft201909-0.019.tar.gz
provides:
JSON::Schema::Draft201909 0.019
JSON::Schema::Draft201909::Annotation 0.019
JSON::Schema::Draft201909::Document 0.019
JSON::Schema::Draft201909::Error 0.019
JSON::Schema::Draft201909::Result 0.019
JSON::Schema::Draft201909::Utilities 0.019
JSON::Schema::Draft201909::Vocabulary 0.019
JSON::Schema::Draft201909::Vocabulary::Applicator 0.019
JSON::Schema::Draft201909::Vocabulary::Content 0.019
JSON::Schema::Draft201909::Vocabulary::Core 0.019
JSON::Schema::Draft201909::Vocabulary::Format 0.019
JSON::Schema::Draft201909::Vocabulary::MetaData 0.019
JSON::Schema::Draft201909::Vocabulary::Validation 0.019
JSON-Schema-Draft201909-0.020
pathname: E/ET/ETHER/JSON-Schema-Draft201909-0.020.tar.gz
provides:
JSON::Schema::Draft201909 0.020
JSON::Schema::Draft201909::Annotation 0.020
JSON::Schema::Draft201909::Document 0.020
JSON::Schema::Draft201909::Error 0.020
JSON::Schema::Draft201909::Result 0.020
JSON::Schema::Draft201909::Utilities 0.020
JSON::Schema::Draft201909::Vocabulary 0.020
JSON::Schema::Draft201909::Vocabulary::Applicator 0.020
JSON::Schema::Draft201909::Vocabulary::Content 0.020
JSON::Schema::Draft201909::Vocabulary::Core 0.020
JSON::Schema::Draft201909::Vocabulary::Format 0.020
JSON::Schema::Draft201909::Vocabulary::MetaData 0.020
JSON::Schema::Draft201909::Vocabulary::Validation 0.020
requirements:
B 0
Carp 0
Expand Down Expand Up @@ -2805,8 +2805,8 @@ DISTRIBUTIONS
Mojolicious 8.50
SQL::Abstract 1.86
perl 5.016
Mojolicious-8.67
pathname: S/SR/SRI/Mojolicious-8.67.tar.gz
Mojolicious-8.70
pathname: S/SR/SRI/Mojolicious-8.70.tar.gz
provides:
Mojo undef
Mojo::Asset undef
Expand Down Expand Up @@ -2875,7 +2875,7 @@ DISTRIBUTIONS
Mojo::UserAgent::Transactor undef
Mojo::Util undef
Mojo::WebSocket undef
Mojolicious 8.67
Mojolicious 8.70
Mojolicious::Command undef
Mojolicious::Command::Author::cpanify undef
Mojolicious::Command::Author::generate undef
Expand Down
7 changes: 2 additions & 5 deletions lib/Conch/Plugin/JSONValidator.pm
Expand Up @@ -3,7 +3,7 @@ package Conch::Plugin::JSONValidator;
use Mojo::Base 'Mojolicious::Plugin', -signatures;

use feature 'unicode_strings';
use JSON::Schema::Draft201909 '0.019';
use JSON::Schema::Draft201909 '0.020';
use YAML::PP;
use Mojo::JSON 'to_json';
use Path::Tiny;
Expand Down Expand Up @@ -137,10 +137,7 @@ Returns a L<JSON::Schema::Draft201909> object with all JSON Schemas pre-loaded.
my $_validator;
$app->helper(json_schema_validator => sub ($c) {
return $_validator if $_validator;
$_validator = JSON::Schema::Draft201909->new(
output_format => 'terse',
validate_formats => 1,
);
$_validator = JSON::Schema::Draft201909->new(output_format => 'terse');
# TODO: blocked on https://github.com/ingydotnet/yaml-libyaml-pm/issues/68
# local $YAML::XS::Boolean = 'JSON::PP'; ... YAML::XS::LoadFile(...)
my $yaml = YAML::PP->new(boolean => 'JSON::PP');
Expand Down
7 changes: 2 additions & 5 deletions misc/validate
Expand Up @@ -4,7 +4,7 @@ use warnings;
use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8

use Getopt::Long;
use JSON::Schema::Draft201909 0.019;
use JSON::Schema::Draft201909 0.020;
use Mojo::File 'path';
use JSON::MaybeXS 'decode_json';
use Pod::Usage;
Expand All @@ -22,10 +22,7 @@ GetOptions(

pod2usage(1) if $help;

my $js = JSON::Schema::Draft201909->new(
output_format => 'basic',
validate_formats => 1,
);
my $js = JSON::Schema::Draft201909->new;

my $schema = $schema_file ? $schema_file : "$schema_url/$name";
$js->add_schema($schema);
Expand Down
2 changes: 1 addition & 1 deletion t/02-json-schemas.t
Expand Up @@ -6,7 +6,7 @@ use Test::More;
use YAML::PP;
use Path::Tiny;
use Try::Tiny;
use JSON::Schema::Draft201909 0.019;
use JSON::Schema::Draft201909 0.020;
use JSON::Schema::Draft201909::Utilities 'canonical_schema_uri';

diag 'using JSON::Schema::Draft201909 '.JSON::Schema::Draft201909->VERSION;
Expand Down

0 comments on commit 9e2ec2d

Please sign in to comment.