Hello community, here is the log from the commit of package perl-JSON-Validator for openSUSE:Factory checked in at 2020-02-20 14:56:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-JSON-Validator (Old) and /work/SRC/openSUSE:Factory/.perl-JSON-Validator.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-JSON-Validator" Thu Feb 20 14:56:03 2020 rev:16 rq:777378 version:3.23 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-JSON-Validator/perl-JSON-Validator.changes 2020-02-18 10:42:41.293223967 +0100 +++ /work/SRC/openSUSE:Factory/.perl-JSON-Validator.new.26092/perl-JSON-Validator.changes 2020-02-20 14:56:14.878390206 +0100 @@ -1,0 +2,9 @@ +Wed Feb 19 03:10:52 UTC 2020 - <timueller+p...@suse.de> + +- updated to 3.23 + see /usr/share/doc/packages/perl-JSON-Validator/Changes + + 3.23 2020-02-19T09:37:44+0900 + - Using List::Util::uniq() instead of JSON::Validator::Util::uniq #198 + +------------------------------------------------------------------- Old: ---- JSON-Validator-3.22.tar.gz New: ---- JSON-Validator-3.23.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-JSON-Validator.spec ++++++ --- /var/tmp/diff_new_pack.ToX5aN/_old 2020-02-20 14:56:15.882392176 +0100 +++ /var/tmp/diff_new_pack.ToX5aN/_new 2020-02-20 14:56:15.882392176 +0100 @@ -17,7 +17,7 @@ Name: perl-JSON-Validator -Version: 3.22 +Version: 3.23 Release: 0 %define cpan_name JSON-Validator Summary: Validate data against a JSON schema @@ -30,16 +30,18 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(List::Util) >= 1.45 BuildRequires: perl(Mojolicious) >= 7.28 BuildRequires: perl(Test::Deep) BuildRequires: perl(Test::More) >= 1.30 +Requires: perl(List::Util) >= 1.45 Requires: perl(Mojolicious) >= 7.28 %{perl_requires} %description JSON::Validator is a data structure validation library based around at https://json-schema.org/. This module can be used directly with a JSON -schema or you can use the elegant DSL schema-builder JSON::Validator::joi +schema or you can use the elegant DSL schema-builder JSON::Validator::Joi to define the schema programmatically. %prep ++++++ JSON-Validator-3.22.tar.gz -> JSON-Validator-3.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/Changes new/JSON-Validator-3.23/Changes --- old/JSON-Validator-3.22/Changes 2020-02-15 00:35:29.000000000 +0100 +++ new/JSON-Validator-3.23/Changes 2020-02-19 01:37:44.000000000 +0100 @@ -1,9 +1,15 @@ Revision history for perl distribution JSON-Validator +3.23 2020-02-19T09:37:44+0900 + - Using List::Util::uniq() instead of JSON::Validator::Util::uniq #198 + 3.22 2020-02-15T08:35:29+0900 - Add support for "dependencies" keyword #192 #197 + Contributor: Karen Etheridge - Add support for anyOf/allOf/oneOf at the same time #196 #197 + Contributor: Karen Etheridge - Allow if/then/else to be in any sort of schema #190 #197 + Contributor: Karen Etheridge 3.21 2020-02-14T10:14:14+0900 - Fix data_section() without a class #193 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/META.json new/JSON-Validator-3.23/META.json --- old/JSON-Validator-3.22/META.json 2020-02-15 00:35:30.000000000 +0100 +++ new/JSON-Validator-3.23/META.json 2020-02-19 01:37:45.000000000 +0100 @@ -34,6 +34,7 @@ }, "runtime" : { "requires" : { + "List::Util" : "1.45", "Mojolicious" : "7.28", "perl" : "5.010001" } @@ -61,6 +62,6 @@ }, "x_IRC" : "irc://irc.freenode.net/#mojo" }, - "version" : "3.22", + "version" : "3.23", "x_serialization_backend" : "JSON::PP version 4.02" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/META.yml new/JSON-Validator-3.23/META.yml --- old/JSON-Validator-3.22/META.yml 2020-02-15 00:35:30.000000000 +0100 +++ new/JSON-Validator-3.23/META.yml 2020-02-19 01:37:45.000000000 +0100 @@ -22,6 +22,7 @@ - examples - t requires: + List::Util: '1.45' Mojolicious: '7.28' perl: '5.010001' resources: @@ -30,5 +31,5 @@ homepage: https://mojolicious.org license: http://www.opensource.org/licenses/artistic-license-2.0 repository: https://github.com/mojolicious/json-validator.git -version: '3.22' +version: '3.23' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/Makefile.PL new/JSON-Validator-3.23/Makefile.PL --- old/JSON-Validator-3.22/Makefile.PL 2019-09-27 03:36:58.000000000 +0200 +++ new/JSON-Validator-3.23/Makefile.PL 2020-02-18 08:56:50.000000000 +0100 @@ -30,11 +30,8 @@ x_IRC => 'irc://irc.freenode.net/#mojo', }, }, - PREREQ_PM => {'Mojolicious' => '7.28'}, - TEST_REQUIRES => { - 'Test::More' => '1.30', - 'Test::Deep' => '0', - }, + PREREQ_PM => {'List::Util' => '1.45', 'Mojolicious' => '7.28'}, + TEST_REQUIRES => {'Test::More' => '1.30', 'Test::Deep' => '0'}, test => {TESTS => (-e 'META.yml' ? 't/*.t' : 't/*.t xt/*.t')}, ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/lib/JSON/Validator/Joi.pm new/JSON-Validator-3.23/lib/JSON/Validator/Joi.pm --- old/JSON-Validator-3.22/lib/JSON/Validator/Joi.pm 2020-02-10 02:38:40.000000000 +0100 +++ new/JSON-Validator-3.23/lib/JSON/Validator/Joi.pm 2020-02-18 08:56:16.000000000 +0100 @@ -1,7 +1,7 @@ package JSON::Validator::Joi; use Mojo::Base -base; -use JSON::Validator::Util 'uniq'; +use List::Util 'uniq'; use Mojo::JSON qw(false true); use Mojo::Util; use Storable 'dclone'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/lib/JSON/Validator/Util.pm new/JSON-Validator-3.23/lib/JSON/Validator/Util.pm --- old/JSON-Validator-3.22/lib/JSON/Validator/Util.pm 2020-02-15 00:33:29.000000000 +0100 +++ new/JSON-Validator-3.23/lib/JSON/Validator/Util.pm 2020-02-18 08:56:16.000000000 +0100 @@ -5,6 +5,7 @@ use Data::Dumper (); use Exporter 'import'; use JSON::Validator::Error; +use List::Util; use Mojo::Collection; use Mojo::JSON; use Mojo::Loader; @@ -12,7 +13,7 @@ use Scalar::Util 'blessed'; our @EXPORT_OK - = qw(E data_checksum data_section data_type is_type schema_extract json_pointer prefix_errors schema_type uniq); + = qw(E data_checksum data_section data_type is_type schema_extract json_pointer prefix_errors schema_type); sub E { JSON::Validator::Error->new(@_) } @@ -144,11 +145,6 @@ return ''; } -sub uniq { - my %uniq; - grep { !$uniq{$_}++ } @_; -} - # _guessed_right($type, $data); sub _guessed_right { return $_[0] if !defined $_[1]; @@ -321,12 +317,6 @@ {"type": "object", "properties": {}} # Faster {"properties": {}} # Slower -=head2 uniq - - @items = uniq @items; - -See L<List::Util/uniq>. - =head1 SEE ALSO L<JSON::Validator>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/lib/JSON/Validator.pm new/JSON-Validator-3.23/lib/JSON/Validator.pm --- old/JSON-Validator-3.22/lib/JSON/Validator.pm 2020-02-15 00:35:29.000000000 +0100 +++ new/JSON-Validator-3.23/lib/JSON/Validator.pm 2020-02-19 01:37:44.000000000 +0100 @@ -9,7 +9,8 @@ use JSON::Validator::Joi; use JSON::Validator::Ref; use JSON::Validator::Util - qw(E data_checksum data_section data_type is_type json_pointer prefix_errors schema_type uniq); + qw(E data_checksum data_section data_type is_type json_pointer prefix_errors schema_type); +use List::Util 'uniq'; use Mojo::File 'path'; use Mojo::JSON::Pointer; use Mojo::JSON qw(false true); @@ -23,7 +24,7 @@ use constant SPECIFICATION_URL => 'http://json-schema.org/draft-04/schema#'; use constant YAML_SUPPORT => eval 'use YAML::XS 0.67;1'; -our $VERSION = '3.22'; +our $VERSION = '3.23'; our @EXPORT_OK = qw(joi validate_json); my $BUNDLED_CACHE_DIR = path(path(__FILE__)->dirname, qw(Validator cache)); @@ -896,10 +897,10 @@ return E $path, [object => additionalProperties => join '/', @k]; } - for my $k (sort uniq @{$schema->{required} || []}) { + for my $k (sort { $a cmp $b } uniq @{$schema->{required} || []}) { next if exists $data->{$k}; push @errors, E json_pointer($path, $k), [object => 'required']; - delete $rules{$k}; # why bother? + delete $rules{$k}; } my $dependencies = $schema->{dependencies} || {}; @@ -1028,7 +1029,7 @@ L<JSON::Validator> is a data structure validation library based around L<JSON Schema|https://json-schema.org/>. This module can be used directly with a JSON schema or you can use the elegant DSL schema-builder -L<JSON::Validator::joi> to define the schema programmatically. +L<JSON::Validator::Joi> to define the schema programmatically. =head2 Supported schema formats diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/t/load-data.t new/JSON-Validator-3.23/t/load-data.t --- old/JSON-Validator-3.22/t/load-data.t 2020-02-14 01:23:39.000000000 +0100 +++ new/JSON-Validator-3.23/t/load-data.t 2020-02-18 08:56:16.000000000 +0100 @@ -26,6 +26,9 @@ eval { Mojolicious::Plugin::TestX->validate('data:///spec.json', {}) }; ok !$@, 'found spec.json in main' or diag $@; +@errors = $jv->schema('data://main/spec.json')->validate({}); +like "@errors", qr{firstName.*lastName}, 'required is sorted'; + package Mojolicious::Plugin::TestX; sub validate { $jv->schema($_[1])->validate($_[2]) } @@ -38,7 +41,7 @@ { "title": "Example Schema", "type": "object", - "required": ["firstName", "lastName"], + "required": ["lastName", "firstName"], "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-Validator-3.22/t/util.t new/JSON-Validator-3.23/t/util.t --- old/JSON-Validator-3.22/t/util.t 2020-02-12 00:54:42.000000000 +0100 +++ new/JSON-Validator-3.23/t/util.t 2020-02-19 01:37:18.000000000 +0100 @@ -2,7 +2,7 @@ use Mojo::JSON 'false'; use JSON::Validator; use JSON::Validator::Util - qw(E data_type schema_type prefix_errors is_type json_pointer uniq); + qw(E data_type schema_type prefix_errors is_type json_pointer); use Test::More; my $e = E '/path/x', 'some error'; @@ -52,6 +52,4 @@ is schema_type({const => 42}), 'const', 'schema_type const'; is schema_type({cannot => 'guess'}), '', 'schema_type no idea'; -is_deeply [uniq(1, '1', 10, 3, 4, 1)], [1, 10, 3, 4], 'uniq'; - done_testing;