Mailinglist Archive: opensuse-commit (1903 mails)

< Previous Next >
commit perl-JSON-Validator for openSUSE:Factory
Hello community,

here is the log from the commit of package perl-JSON-Validator for
openSUSE:Factory checked in at 2019-04-08 10:40:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-JSON-Validator (Old)
and /work/SRC/openSUSE:Factory/.perl-JSON-Validator.new.3908 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-JSON-Validator"

Mon Apr 8 10:40:09 2019 rev:3 rq:692128 version:3.08

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-JSON-Validator/perl-JSON-Validator.changes
2019-04-05 12:06:53.386578610 +0200
+++
/work/SRC/openSUSE:Factory/.perl-JSON-Validator.new.3908/perl-JSON-Validator.changes
2019-04-08 10:40:44.219301283 +0200
@@ -1,0 +2,12 @@
+Sun Apr 7 05:09:45 UTC 2019 - Stephan Kulow <coolo@xxxxxxxx>
+
+- updated to 3.08
+ see /usr/share/doc/packages/perl-JSON-Validator/Changes
+
+ 3.08 2019-04-06T15:07:11+0700
+ - Add support for "default" in object definitions #155
+ - Add support for coerce("bool,def,num,str") as alternative to hash
+ - Add support for setting coerce in new()
+ - Deprecated support for coerce(1)
+
+-------------------------------------------------------------------

Old:
----
JSON-Validator-3.07.tar.gz

New:
----
JSON-Validator-3.08.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-JSON-Validator.spec ++++++
--- /var/tmp/diff_new_pack.ciXYPV/_old 2019-04-08 10:40:44.907301451 +0200
+++ /var/tmp/diff_new_pack.ciXYPV/_new 2019-04-08 10:40:44.911301452 +0200
@@ -17,7 +17,7 @@


Name: perl-JSON-Validator
-Version: 3.07
+Version: 3.08
Release: 0
%define cpan_name JSON-Validator
Summary: Validate data against a JSON schema

++++++ JSON-Validator-3.07.tar.gz -> JSON-Validator-3.08.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/.vstags
new/JSON-Validator-3.08/.vstags
--- old/JSON-Validator-3.07/.vstags 1970-01-01 01:00:00.000000000 +0100
+++ new/JSON-Validator-3.08/.vstags 2019-04-06 10:02:22.000000000 +0200
@@ -0,0 +1,292 @@
+!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;"
to lines/
+!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@xxxxxxxxxxxxxxxxxxxxx/
+!_TAG_PROGRAM_NAME Exuberant Ctags //
+!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
+!_TAG_PROGRAM_VERSION 5.8 //
+CASE_TOLERANT lib/JSON/Validator.pm 20;" c
+COLORS lib/JSON/Validator.pm 21;" c
+D lib/JSON/Validator.pm 36;" s
+DATA_VALIDATE_DOMAIN lib/JSON/Validator/Formats.pm 4;" c
+DATA_VALIDATE_IP lib/JSON/Validator/Formats.pm 5;" c
+DEBUG lib/JSON/Validator.pm 22;" c
+E lib/JSON/Validator.pm 41;" s
+EXISTS lib/JSON/Validator/Ref.pm 14;" s
+FETCH lib/JSON/Validator/Ref.pm 18;" s
+FIRSTKEY lib/JSON/Validator/Ref.pm 21;" s
+JSON::Validator lib/JSON/Validator.pm 1;" p
+JSON::Validator::CASE_TOLERANT lib/JSON/Validator.pm 20;" c
+JSON::Validator::COLORS lib/JSON/Validator.pm 21;" c
+JSON::Validator::D lib/JSON/Validator.pm 36;" s
+JSON::Validator::DEBUG lib/JSON/Validator.pm 22;" c
+JSON::Validator::E lib/JSON/Validator.pm 41;" s
+JSON::Validator::Error lib/JSON/Validator/Error.pm 1;" p
+JSON::Validator::Error::TO_JSON lib/JSON/Validator/Error.pm 15;"
s
+JSON::Validator::Error::message lib/JSON/Validator/Error.pm 12;"
s
+JSON::Validator::Error::new lib/JSON/Validator/Error.pm 6;" s
+JSON::Validator::Error::path lib/JSON/Validator/Error.pm 13;" s
+JSON::Validator::Error::to_string lib/JSON/Validator/Error.pm 14;"
s
+JSON::Validator::Formats lib/JSON/Validator/Formats.pm 1;" p
+JSON::Validator::Formats::DATA_VALIDATE_DOMAIN lib/JSON/Validator/Formats.pm
4;" c
+JSON::Validator::Formats::DATA_VALIDATE_IP lib/JSON/Validator/Formats.pm
5;" c
+JSON::Validator::Formats::NET_IDN_ENCODE lib/JSON/Validator/Formats.pm
6;" c
+JSON::Validator::Formats::WARN_MISSING_MODULE lib/JSON/Validator/Formats.pm
7;" c
+JSON::Validator::Formats::_module_missing lib/JSON/Validator/Formats.pm
184;" s
+JSON::Validator::Formats::check_date lib/JSON/Validator/Formats.pm 11;"
s
+JSON::Validator::Formats::check_date_time lib/JSON/Validator/Formats.pm
24;" s
+JSON::Validator::Formats::check_email lib/JSON/Validator/Formats.pm 38;"
s
+JSON::Validator::Formats::check_hostname lib/JSON/Validator/Formats.pm
54;" s
+JSON::Validator::Formats::check_idn_email lib/JSON/Validator/Formats.pm
61;" s
+JSON::Validator::Formats::check_idn_hostname lib/JSON/Validator/Formats.pm
78;" s
+JSON::Validator::Formats::check_ipv4 lib/JSON/Validator/Formats.pm 126;"
s
+JSON::Validator::Formats::check_ipv6 lib/JSON/Validator/Formats.pm 134;"
s
+JSON::Validator::Formats::check_iri lib/JSON/Validator/Formats.pm 87;"
s
+JSON::Validator::Formats::check_iri_reference lib/JSON/Validator/Formats.pm
93;" s
+JSON::Validator::Formats::check_json_pointer lib/JSON/Validator/Formats.pm
121;" s
+JSON::Validator::Formats::check_regex lib/JSON/Validator/Formats.pm 151;"
s
+JSON::Validator::Formats::check_relative_json_pointer
lib/JSON/Validator/Formats.pm 140;" s
+JSON::Validator::Formats::check_time lib/JSON/Validator/Formats.pm 155;"
s
+JSON::Validator::Formats::check_uri lib/JSON/Validator/Formats.pm 168;"
s
+JSON::Validator::Formats::check_uri_reference lib/JSON/Validator/Formats.pm
175;" s
+JSON::Validator::Formats::check_uri_template lib/JSON/Validator/Formats.pm
180;" s
+JSON::Validator::Joi lib/JSON/Validator/Joi.pm 1;" p
+JSON::Validator::Joi::TO_JSON lib/JSON/Validator/Joi.pm 152;" s
+JSON::Validator::Joi::_compile_array lib/JSON/Validator/Joi.pm 88;"
s
+JSON::Validator::Joi::_compile_boolean lib/JSON/Validator/Joi.pm 101;"
s
+JSON::Validator::Joi::_compile_integer lib/JSON/Validator/Joi.pm 103;"
s
+JSON::Validator::Joi::_compile_null lib/JSON/Validator/Joi.pm 105;"
s
+JSON::Validator::Joi::_compile_number lib/JSON/Validator/Joi.pm 107;"
s
+JSON::Validator::Joi::_compile_object lib/JSON/Validator/Joi.pm 119;"
s
+JSON::Validator::Joi::_compile_string lib/JSON/Validator/Joi.pm 134;"
s
+JSON::Validator::Joi::_type lib/JSON/Validator/Joi.pm 147;" s
+JSON::Validator::Joi::alphanum lib/JSON/Validator/Joi.pm 19;" s
+JSON::Validator::Joi::array lib/JSON/Validator/Joi.pm 53;" s
+JSON::Validator::Joi::boolean lib/JSON/Validator/Joi.pm 20;" s
+JSON::Validator::Joi::compile lib/JSON/Validator/Joi.pm 22;" s
+JSON::Validator::Joi::date_time lib/JSON/Validator/Joi.pm 35;"
s
+JSON::Validator::Joi::email lib/JSON/Validator/Joi.pm 36;" s
+JSON::Validator::Joi::extend lib/JSON/Validator/Joi.pm 38;" s
+JSON::Validator::Joi::integer lib/JSON/Validator/Joi.pm 54;" s
+JSON::Validator::Joi::iso_date lib/JSON/Validator/Joi.pm 55;" s
+JSON::Validator::Joi::items lib/JSON/Validator/Joi.pm 56;" s
+JSON::Validator::Joi::length lib/JSON/Validator/Joi.pm 57;" s
+JSON::Validator::Joi::lowercase lib/JSON/Validator/Joi.pm 58;"
s
+JSON::Validator::Joi::negative lib/JSON/Validator/Joi.pm 59;" s
+JSON::Validator::Joi::number lib/JSON/Validator/Joi.pm 60;" s
+JSON::Validator::Joi::object lib/JSON/Validator/Joi.pm 61;" s
+JSON::Validator::Joi::pattern lib/JSON/Validator/Joi.pm 62;" s
+JSON::Validator::Joi::positive lib/JSON/Validator/Joi.pm 63;" s
+JSON::Validator::Joi::props lib/JSON/Validator/Joi.pm 65;" s
+JSON::Validator::Joi::string lib/JSON/Validator/Joi.pm 77;" s
+JSON::Validator::Joi::token lib/JSON/Validator/Joi.pm 78;" s
+JSON::Validator::Joi::uppercase lib/JSON/Validator/Joi.pm 79;"
s
+JSON::Validator::Joi::uri lib/JSON/Validator/Joi.pm 80;" s
+JSON::Validator::Joi::validate lib/JSON/Validator/Joi.pm 82;" s
+JSON::Validator::RECURSION_LIMIT lib/JSON/Validator.pm 24;" c
+JSON::Validator::REPORT lib/JSON/Validator.pm 23;" c
+JSON::Validator::Ref lib/JSON/Validator/Ref.pm 1;" p
+JSON::Validator::Ref::EXISTS lib/JSON/Validator/Ref.pm 14;" s
+JSON::Validator::Ref::FETCH lib/JSON/Validator/Ref.pm 18;" s
+JSON::Validator::Ref::FIRSTKEY lib/JSON/Validator/Ref.pm 21;" s
+JSON::Validator::Ref::KEYS lib/JSON/Validator/Ref.pm 22;" s
+JSON::Validator::Ref::NEXTKEY lib/JSON/Validator/Ref.pm 23;" s
+JSON::Validator::Ref::SCALAR lib/JSON/Validator/Ref.pm 24;" s
+JSON::Validator::Ref::TIEHASH lib/JSON/Validator/Ref.pm 26;" s
+JSON::Validator::Ref::TO_JSON lib/JSON/Validator/Ref.pm 36;" s
+JSON::Validator::Ref::fqn lib/JSON/Validator/Ref.pm 9;" s
+JSON::Validator::Ref::ref lib/JSON/Validator/Ref.pm 10;" s
+JSON::Validator::Ref::schema lib/JSON/Validator/Ref.pm 11;" s
+JSON::Validator::S lib/JSON/Validator.pm 43;" s
+JSON::Validator::SPECIFICATION_URL lib/JSON/Validator.pm 25;" c
+JSON::Validator::_add_path_to_error_messages lib/JSON/Validator.pm 995;"
s
+JSON::Validator::_build_formats lib/JSON/Validator.pm 208;" s
+JSON::Validator::_cmp lib/JSON/Validator.pm 1011;" s
+JSON::Validator::_expected lib/JSON/Validator.pm 1018;" s
+JSON::Validator::_get lib/JSON/Validator.pm 232;" s
+JSON::Validator::_guess_data_type lib/JSON/Validator.pm 1025;" s
+JSON::Validator::_guess_schema_type lib/JSON/Validator.pm 1042;" s
+JSON::Validator::_guessed_right lib/JSON/Validator.pm 1072;" s
+JSON::Validator::_id_key lib/JSON/Validator.pm 269;" s
+JSON::Validator::_is_number lib/JSON/Validator.pm 1078;" s
+JSON::Validator::_load_schema lib/JSON/Validator.pm 271;" s
+JSON::Validator::_load_schema_from_text lib/JSON/Validator.pm 315;"
s
+JSON::Validator::_load_schema_from_url lib/JSON/Validator.pm 342;" s
+JSON::Validator::_location_to_abs lib/JSON/Validator.pm 491;" s
+JSON::Validator::_path lib/JSON/Validator.pm 1084;" s
+JSON::Validator::_ref_to_schema lib/JSON/Validator.pm 374;" s
+JSON::Validator::_register_schema lib/JSON/Validator.pm 388;" s
+JSON::Validator::_report lib/JSON/Validator.pm 394;" s
+JSON::Validator::_report_colored lib/JSON/Validator.pm 400;" s
+JSON::Validator::_report_errors lib/JSON/Validator.pm 407;" s
+JSON::Validator::_report_schema lib/JSON/Validator.pm 417;" s
+JSON::Validator::_resolve lib/JSON/Validator.pm 425;" s
+JSON::Validator::_resolve_ref lib/JSON/Validator.pm 504;" s
+JSON::Validator::_stack lib/JSON/Validator.pm 535;" s
+JSON::Validator::_uniq lib/JSON/Validator.pm 1091;" s
+JSON::Validator::_validate lib/JSON/Validator.pm 547;" s
+JSON::Validator::_validate_all_of lib/JSON/Validator.pm 614;" s
+JSON::Validator::_validate_any_of lib/JSON/Validator.pm 640;" s
+JSON::Validator::_validate_format lib/JSON/Validator.pm 724;" s
+JSON::Validator::_validate_one_of lib/JSON/Validator.pm 666;" s
+JSON::Validator::_validate_type_any lib/JSON/Validator.pm 733;" s
+JSON::Validator::_validate_type_array lib/JSON/Validator.pm 735;" s
+JSON::Validator::_validate_type_boolean lib/JSON/Validator.pm 794;"
s
+JSON::Validator::_validate_type_const lib/JSON/Validator.pm 714;" s
+JSON::Validator::_validate_type_enum lib/JSON/Validator.pm 700;" s
+JSON::Validator::_validate_type_integer lib/JSON/Validator.pm 819;"
s
+JSON::Validator::_validate_type_null lib/JSON/Validator.pm 828;" s
+JSON::Validator::_validate_type_number lib/JSON/Validator.pm 835;" s
+JSON::Validator::_validate_type_object lib/JSON/Validator.pm 873;" s
+JSON::Validator::_validate_type_string lib/JSON/Validator.pm 953;" s
+JSON::Validator::bundle lib/JSON/Validator.pm 63;" s
+JSON::Validator::coerce lib/JSON/Validator.pm 130;" s
+JSON::Validator::get lib/JSON/Validator.pm 149;" s
+JSON::Validator::joi lib/JSON/Validator.pm 156;" s
+JSON::Validator::load_and_validate_schema lib/JSON/Validator.pm 162;"
s
+JSON::Validator::new lib/JSON/Validator.pm 174;" s
+JSON::Validator::schema lib/JSON/Validator.pm 180;" s
+JSON::Validator::singleton lib/JSON/Validator.pm 187;" s
+JSON::Validator::validate lib/JSON/Validator.pm 189;" s
+JSON::Validator::validate_json lib/JSON/Validator.pm 204;" s
+KEYS lib/JSON/Validator/Ref.pm 22;" s
+NET_IDN_ENCODE lib/JSON/Validator/Formats.pm 6;" c
+NEXTKEY lib/JSON/Validator/Ref.pm 23;" s
+RECURSION_LIMIT lib/JSON/Validator.pm 24;" c
+REPORT lib/JSON/Validator.pm 23;" c
+S lib/JSON/Validator.pm 43;" s
+SCALAR lib/JSON/Validator/Ref.pm 24;" s
+SPECIFICATION_URL lib/JSON/Validator.pm 25;" c
+Some t/stack/Some.pm 1;" p
+Some::Module t/stack/Some/Module.pm 1;" p
+Some::Module::validate_age0 t/stack/Some/Module.pm 4;" s
+Some::Module::validate_age1 t/stack/Some/Module.pm 5;" s
+Some::j t/stack/Some.pm 4;" s
+Some::validate_age0 t/stack/Some.pm 5;" s
+Some::validate_age1 t/stack/Some.pm 6;" s
+TIEHASH lib/JSON/Validator/Ref.pm 26;" s
+TO_JSON lib/JSON/Validator/Error.pm 15;" s
+TO_JSON lib/JSON/Validator/Joi.pm 152;" s
+TO_JSON lib/JSON/Validator/Ref.pm 36;" s
+WARN_MISSING_MODULE lib/JSON/Validator/Formats.pm 7;" c
+_add_path_to_error_messages lib/JSON/Validator.pm 995;" s
+_build_formats lib/JSON/Validator.pm 208;" s
+_cmp lib/JSON/Validator.pm 1011;" s
+_compile_array lib/JSON/Validator/Joi.pm 88;" s
+_compile_boolean lib/JSON/Validator/Joi.pm 101;" s
+_compile_integer lib/JSON/Validator/Joi.pm 103;" s
+_compile_null lib/JSON/Validator/Joi.pm 105;" s
+_compile_number lib/JSON/Validator/Joi.pm 107;" s
+_compile_object lib/JSON/Validator/Joi.pm 119;" s
+_compile_string lib/JSON/Validator/Joi.pm 134;" s
+_expected lib/JSON/Validator.pm 1018;" s
+_get lib/JSON/Validator.pm 232;" s
+_guess_data_type lib/JSON/Validator.pm 1025;" s
+_guess_schema_type lib/JSON/Validator.pm 1042;" s
+_guessed_right lib/JSON/Validator.pm 1072;" s
+_id_key lib/JSON/Validator.pm 269;" s
+_is_number lib/JSON/Validator.pm 1078;" s
+_load_schema lib/JSON/Validator.pm 271;" s
+_load_schema_from_text lib/JSON/Validator.pm 315;" s
+_load_schema_from_url lib/JSON/Validator.pm 342;" s
+_location_to_abs lib/JSON/Validator.pm 491;" s
+_module_missing lib/JSON/Validator/Formats.pm 184;" s
+_path lib/JSON/Validator.pm 1084;" s
+_ref_to_schema lib/JSON/Validator.pm 374;" s
+_register_schema lib/JSON/Validator.pm 388;" s
+_report lib/JSON/Validator.pm 394;" s
+_report_colored lib/JSON/Validator.pm 400;" s
+_report_errors lib/JSON/Validator.pm 407;" s
+_report_schema lib/JSON/Validator.pm 417;" s
+_resolve lib/JSON/Validator.pm 425;" s
+_resolve_ref lib/JSON/Validator.pm 504;" s
+_stack lib/JSON/Validator.pm 535;" s
+_type lib/JSON/Validator/Joi.pm 147;" s
+_uniq lib/JSON/Validator.pm 1091;" s
+_validate lib/JSON/Validator.pm 547;" s
+_validate_all_of lib/JSON/Validator.pm 614;" s
+_validate_any_of lib/JSON/Validator.pm 640;" s
+_validate_format lib/JSON/Validator.pm 724;" s
+_validate_one_of lib/JSON/Validator.pm 666;" s
+_validate_type_any lib/JSON/Validator.pm 733;" s
+_validate_type_array lib/JSON/Validator.pm 735;" s
+_validate_type_boolean lib/JSON/Validator.pm 794;" s
+_validate_type_const lib/JSON/Validator.pm 714;" s
+_validate_type_enum lib/JSON/Validator.pm 700;" s
+_validate_type_integer lib/JSON/Validator.pm 819;" s
+_validate_type_null lib/JSON/Validator.pm 828;" s
+_validate_type_number lib/JSON/Validator.pm 835;" s
+_validate_type_object lib/JSON/Validator.pm 873;" s
+_validate_type_string lib/JSON/Validator.pm 953;" s
+alphanum lib/JSON/Validator/Joi.pm 19;" s
+array lib/JSON/Validator/Joi.pm 53;" s
+boolean lib/JSON/Validator/Joi.pm 20;" s
+bundle lib/JSON/Validator.pm 63;" s
+check_date lib/JSON/Validator/Formats.pm 11;" s
+check_date_time lib/JSON/Validator/Formats.pm 24;" s
+check_email lib/JSON/Validator/Formats.pm 38;" s
+check_hostname lib/JSON/Validator/Formats.pm 54;" s
+check_idn_email lib/JSON/Validator/Formats.pm 61;" s
+check_idn_hostname lib/JSON/Validator/Formats.pm 78;" s
+check_ipv4 lib/JSON/Validator/Formats.pm 126;" s
+check_ipv6 lib/JSON/Validator/Formats.pm 134;" s
+check_iri lib/JSON/Validator/Formats.pm 87;" s
+check_iri_reference lib/JSON/Validator/Formats.pm 93;" s
+check_json_pointer lib/JSON/Validator/Formats.pm 121;" s
+check_regex lib/JSON/Validator/Formats.pm 151;" s
+check_relative_json_pointer lib/JSON/Validator/Formats.pm 140;" s
+check_time lib/JSON/Validator/Formats.pm 155;" s
+check_uri lib/JSON/Validator/Formats.pm 168;" s
+check_uri_reference lib/JSON/Validator/Formats.pm 175;" s
+check_uri_template lib/JSON/Validator/Formats.pm 180;" s
+coerce lib/JSON/Validator.pm 130;" s
+compile lib/JSON/Validator/Joi.pm 22;" s
+date_time lib/JSON/Validator/Joi.pm 35;" s
+edj t/Helper.pm 11;" s
+email lib/JSON/Validator/Joi.pm 36;" s
+extend lib/JSON/Validator/Joi.pm 38;" s
+fqn lib/JSON/Validator/Ref.pm 9;" s
+get lib/JSON/Validator.pm 149;" s
+import t/Helper.pm 41;" s
+integer lib/JSON/Validator/Joi.pm 54;" s
+iso_date lib/JSON/Validator/Joi.pm 55;" s
+items lib/JSON/Validator/Joi.pm 56;" s
+j t/stack/Some.pm 4;" s
+joi lib/JSON/Validator.pm 156;" s
+joi_ok t/Helper.pm 15;" s
+jv t/Helper.pm 27;" s
+length lib/JSON/Validator/Joi.pm 57;" s
+load_and_validate_schema lib/JSON/Validator.pm 162;" s
+lowercase lib/JSON/Validator/Joi.pm 58;" s
+message lib/JSON/Validator/Error.pm 12;" s
+negative lib/JSON/Validator/Joi.pm 59;" s
+new lib/JSON/Validator.pm 174;" s
+new lib/JSON/Validator/Error.pm 6;" s
+number lib/JSON/Validator/Joi.pm 60;" s
+object lib/JSON/Validator/Joi.pm 61;" s
+path lib/JSON/Validator/Error.pm 13;" s
+pattern lib/JSON/Validator/Joi.pm 62;" s
+positive lib/JSON/Validator/Joi.pm 63;" s
+props lib/JSON/Validator/Joi.pm 65;" s
+ref lib/JSON/Validator/Ref.pm 10;" s
+schema lib/JSON/Validator.pm 180;" s
+schema lib/JSON/Validator/Ref.pm 11;" s
+singleton lib/JSON/Validator.pm 187;" s
+string lib/JSON/Validator/Joi.pm 77;" s
+t::Helper t/Helper.pm 1;" p
+t::Helper::edj t/Helper.pm 11;" s
+t::Helper::import t/Helper.pm 41;" s
+t::Helper::joi_ok t/Helper.pm 15;" s
+t::Helper::jv t/Helper.pm 27;" s
+t::Helper::validate_ok t/Helper.pm 29;" s
+to_string lib/JSON/Validator/Error.pm 14;" s
+token lib/JSON/Validator/Joi.pm 78;" s
+uppercase lib/JSON/Validator/Joi.pm 79;" s
+uri lib/JSON/Validator/Joi.pm 80;" s
+validate lib/JSON/Validator.pm 189;" s
+validate lib/JSON/Validator/Joi.pm 82;" s
+validate_age0 t/stack/Some.pm 5;" s
+validate_age0 t/stack/Some/Module.pm 4;" s
+validate_age1 t/stack/Some.pm 6;" s
+validate_age1 t/stack/Some/Module.pm 5;" s
+validate_json lib/JSON/Validator.pm 204;" s
+validate_ok t/Helper.pm 29;" s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/Changes
new/JSON-Validator-3.08/Changes
--- old/JSON-Validator-3.07/Changes 2019-04-04 18:43:55.000000000 +0200
+++ new/JSON-Validator-3.08/Changes 2019-04-06 10:07:11.000000000 +0200
@@ -1,5 +1,11 @@
Revision history for perl distribution JSON-Validator

+3.08 2019-04-06T15:07:11+0700
+ - Add support for "default" in object definitions #155
+ - Add support for coerce("bool,def,num,str") as alternative to hash
+ - Add support for setting coerce in new()
+ - Deprecated support for coerce(1)
+
3.07 2019-04-04T23:43:55+0700
- Fix not leaking file names with bundle()

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/MANIFEST
new/JSON-Validator-3.08/MANIFEST
--- old/JSON-Validator-3.07/MANIFEST 2019-04-04 18:43:56.000000000 +0200
+++ new/JSON-Validator-3.08/MANIFEST 2019-04-06 10:07:12.000000000 +0200
@@ -4,6 +4,7 @@
.github/PULL_REQUEST_TEMPLATE.md
.perltidyrc
.travis.yml
+.vstags
Changes
lib/JSON/Validator.pm
lib/JSON/Validator/cache/10a5eeb37fcd5d829449028f7ceb0774
@@ -26,6 +27,7 @@
t/acceptance.t
t/booleans.t
t/bundle.t
+t/coerce-default.t
t/coerce.t
t/deep-mixed-ref.t
t/definitions/age.json
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/META.json
new/JSON-Validator-3.08/META.json
--- old/JSON-Validator-3.07/META.json 2019-04-04 18:43:56.000000000 +0200
+++ new/JSON-Validator-3.08/META.json 2019-04-06 10:07:12.000000000 +0200
@@ -60,6 +60,6 @@
},
"x_IRC" : "irc://irc.freenode.net/#mojo"
},
- "version" : "3.07",
+ "version" : "3.08",
"x_serialization_backend" : "JSON::PP version 2.97001"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/META.yml
new/JSON-Validator-3.08/META.yml
--- old/JSON-Validator-3.07/META.yml 2019-04-04 18:43:56.000000000 +0200
+++ new/JSON-Validator-3.08/META.yml 2019-04-06 10:07:12.000000000 +0200
@@ -29,5 +29,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.07'
+version: '3.08'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/lib/JSON/Validator/Joi.pm
new/JSON-Validator-3.08/lib/JSON/Validator/Joi.pm
--- old/JSON-Validator-3.07/lib/JSON/Validator/Joi.pm 2019-04-04
18:41:08.000000000 +0200
+++ new/JSON-Validator-3.08/lib/JSON/Validator/Joi.pm 2019-04-06
05:11:01.000000000 +0200
@@ -1,11 +1,12 @@
package JSON::Validator::Joi;
use Mojo::Base -base;

-use Exporter 'import';
-use JSON::Validator;
use Mojo::JSON qw(false true);
use Mojo::Util;

+# Avoid "Subroutine redefined" warnings
+require JSON::Validator;
+
has enum => sub { +[] };
has [qw(format max min multiple_of regex)] => undef;
has type => 'object';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/lib/JSON/Validator.pm
new/JSON-Validator-3.08/lib/JSON/Validator.pm
--- old/JSON-Validator-3.07/lib/JSON/Validator.pm 2019-04-04
18:43:55.000000000 +0200
+++ new/JSON-Validator-3.08/lib/JSON/Validator.pm 2019-04-06
10:07:11.000000000 +0200
@@ -24,7 +24,7 @@
use constant RECURSION_LIMIT => $ENV{JSON_VALIDATOR_RECURSION_LIMIT} || 100;
use constant SPECIFICATION_URL => 'http://json-schema.org/draft-04/schema#';

-our $VERSION = '3.07';
+our $VERSION = '3.08';
our @EXPORT_OK = qw(joi validate_json);

# $YAML_LOADER should be considered internal
@@ -37,6 +37,7 @@
Data::Dumper->new([@_])->Sortkeys(1)->Indent(0)->Maxdepth(2)->Pair(':')
->Useqq(1)->Terse(1)->Dump;
}
+
sub E { JSON::Validator::Error->new(@_) }

sub S {
@@ -128,12 +129,21 @@

sub coerce {
my $self = shift;
- return $self->{coerce} ||= {} unless @_;
- $self->{coerce}
- = $_[0] eq '1' ? {booleans => 1, numbers => 1, strings => 1}
- : ref $_[0] ? {%{$_[0]}}
- : {@_};
- $self;
+ return $self->{coerce} ||= {} unless defined(my $what = shift);
+
+ if ($what eq '1') {
+ Mojo::Util::deprecated('coerce(1) will be deprecated.');
+ $what = {booleans => 1, numbers => 1, strings => 1};
+ }
+
+ state $short = {bool => 'booleans', def => 'defaults', num => 'numbers',
+ str => 'strings'};
+
+ $what = {map { ($_ => 1) } split /,/, $what} unless ref $what;
+ $self->{coerce} = {};
+ $self->{coerce}{($short->{$_} || $_)} = $what->{$_} for keys %$what;
+
+ return $self;
}

sub get {
@@ -161,6 +171,12 @@
$self;
}

+sub new {
+ my $self = shift->SUPER::new(@_);
+ $self->coerce($self->{coerce}) if defined $self->{coerce};
+ return $self;
+}
+
sub schema {
my $self = shift;
return $self->{schema} unless @_;
@@ -318,6 +334,7 @@
die "[JSON::Validator] YAML::XS 0.67 is missing or could not be loaded."
unless $YAML_LOADER;

+ no warnings 'once';
local $YAML::XS::Boolean = 'JSON::PP';
return $visit->($YAML_LOADER->($$text));
}
@@ -376,15 +393,17 @@

sub _report {
my $table = Mojo::Util::tablify($_[0]->{report});
- $table =~ s!^(\W*)(N?OK|<<<)(.*)!{
- my ($x, $y, $z) = ($1, $2, $3);
- my $c = $y eq 'OK' ? 'green' : $y eq '<<<' ? 'blue' : 'magenta';
- $c = "$c bold" if $z =~ /\s\w+Of\s/;
- Term::ANSIColor::colored([$c], "$x$y$z")
- }!gme if COLORS;
+ $table =~ s!^(\W*)(N?OK|<<<)(.*)!{_report_colored()}!gme;
warn "---\n$table";
}

+sub _report_colored {
+ my ($x, $y, $z) = ($1, $2, $3);
+ my $c = $y eq 'OK' ? 'green' : $y eq '<<<' ? 'blue' : 'magenta';
+ $c = "$c bold" if $z =~ /\s\w+Of\s/;
+ Term::ANSIColor::colored([$c], "$x$y$z");
+}
+
sub _report_errors {
my ($self, $path, $type, $errors) = @_;
push @{$self->{report}},
@@ -883,9 +902,13 @@
: $self->_validate($data, $path, $schema->{then} // {});
}

+ my $coerce_defaults = $self->{coerce}{defaults};
while (my ($k, $r) = each %{$schema->{properties}}) {
push @{$rules{$k}}, $r;
+ next unless $coerce_defaults;
+ $data->{$k} = $r->{default} if exists $r->{default} and !exists
$data->{$k};
}
+
while (my ($p, $r) = each %{$schema->{patternProperties} || {}}) {
push @{$rules{$_}}, $r for sort grep { $_ =~ /$p/ } @dkeys;
}
@@ -1305,13 +1328,40 @@

=head2 coerce

- my $jv = $jv->coerce(booleans => 1, numbers => 1, strings => 1);
- my $jv = $jv->coerce({booleans => 1, numbers => 1, strings => 1});
- my $hash_ref = $jv->coerce;
+ my $jv = $jv->coerce('bool,def,num,str');
+ my $jv = $jv->coerce('booleans,defaults,numbers,strings');
+ my $hash_ref = $jv->coerce;

Set the given type to coerce. Before enabling coercion this module is very
strict when it comes to validating types. Example: The string C<"1"> is not
-the same as the number C<1>, unless you have coercion enabled.
+the same as the number C<1>, unless you have "numbers" coercion enabled.
+
+=over 2
+
+=item * booleans
+
+Will convert what looks can be interpreted as a boolean to a
+L<JSON::PP::Boolean> object. Note that "foo" is not considered a true value and
+will fail the validation.
+
+=item * defaults
+
+Will copy the default value defined in the schema, into the input structure,
+if the input value is non-existing.
+
+Note that support for "default" is currently EXPERIMENTAL, and enabling this
+might be changed in future versions.
+
+=item * numbers
+
+Will convert strings that looks like numbers, into true numbers. This works for
+both the "integer" and "number" types.
+
+=item * strings
+
+Will convert a number into a string. This works for the "string" type.
+
+=back

Loading a YAML document will enable "booleans" automatically. This feature is
experimental, but was added since YAML has no real concept of booleans, such
@@ -1333,6 +1383,13 @@
The argument can also be an array-ref with the different parts of the pointer
as each elements.

+=head2 new
+
+ $jv = JSON::Validator->new(%attributes);
+ $jv = JSON::Validator->new(\%attributes);
+
+Creates a new L<JSON::Validate> object.
+
=head2 load_and_validate_schema

my $jv = $jv->load_and_validate_schema($schema, \%args);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/booleans.t
new/JSON-Validator-3.08/t/booleans.t
--- old/JSON-Validator-3.07/t/booleans.t 2019-04-04 18:41:08.000000000
+0200
+++ new/JSON-Validator-3.08/t/booleans.t 2019-04-06 10:02:47.000000000
+0200
@@ -11,7 +11,7 @@
validate_ok {v => Mojo::JSON->true}, $schema;
validate_ok {v => Mojo::JSON->false}, $schema;

-jv->coerce(booleans => 1);
+jv->coerce('booleans');
validate_ok {v => !!1}, $schema;
validate_ok {v => !!0}, $schema;
validate_ok {v => 'false'}, $schema;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/coerce-default.t
new/JSON-Validator-3.08/t/coerce-default.t
--- old/JSON-Validator-3.07/t/coerce-default.t 1970-01-01 01:00:00.000000000
+0100
+++ new/JSON-Validator-3.08/t/coerce-default.t 2019-04-06 10:02:47.000000000
+0200
@@ -0,0 +1,40 @@
+use Mojo::Base -strict;
+use JSON::Validator;
+use Mojo::JSON qw(false true);
+use Test::More;
+
+my $jv = JSON::Validator->new(coerce => 'defaults');
+is_deeply($jv->coerce, {defaults => 1}, 'coerce defaults');
+
+$jv->coerce('def');
+is_deeply($jv->coerce, {defaults => 1}, 'coerce def');
+
+$jv->schema({
+ type => 'object',
+ definitions => {subscribed_to => {type => 'array', default => []}},
+ properties => {
+ tos => {type => 'boolean', default => false},
+ subscribed_to => {'$ref' => '#/definitions/subscribed_to'}
+ },
+});
+
+my $data = {};
+my @errors = $jv->validate($data);
+is_deeply \@errors, [], 'defaults pass validation';
+is_deeply $data, {tos => false, subscribed_to => []}, 'data was mutated';
+
+$data->{tos} = true;
+@errors = $jv->validate($data);
+is_deeply $data, {tos => true, subscribed_to => []},
+ 'only subscribed_to was mutated';
+
+$jv->schema({
+ type => 'object',
+ properties => {tos => {type => 'boolean', default => 'invalid'}},
+});
+
+@errors = $jv->validate({});
+is $errors[0]{message}, 'Expected boolean - got string.',
+ 'default values must be valid';
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/jv-array.t
new/JSON-Validator-3.08/t/jv-array.t
--- old/JSON-Validator-3.07/t/jv-array.t 2019-02-14 18:22:25.000000000
+0100
+++ new/JSON-Validator-3.08/t/jv-array.t 2019-04-06 10:02:47.000000000
+0200
@@ -40,7 +40,7 @@
E('/0', 'Expected string - got number.'), E('/1', 'Not in enum list: Nope.');

# Make sure all similar numbers gets converted from strings
-my $jv = JSON::Validator->new->coerce(1);
+my $jv = JSON::Validator->new->coerce('numbers');
my @numbers;

$jv->schema({type => 'array', items => {type => 'number'}});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/jv-boolean.t
new/JSON-Validator-3.08/t/jv-boolean.t
--- old/JSON-Validator-3.07/t/jv-boolean.t 2019-04-04 18:41:08.000000000
+0200
+++ new/JSON-Validator-3.08/t/jv-boolean.t 2019-04-06 10:02:47.000000000
+0200
@@ -22,7 +22,7 @@
E('/', 'Expected boolean - got string.');
validate_ok undef, {properties => {}}, E('/', 'Expected object - got null.');

-jv->coerce(1);
+jv->coerce('bool');
validate_ok {nick => 1000}, $schema;
validate_ok {nick => 0.5}, $schema;

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/jv-integer.t
new/JSON-Validator-3.08/t/jv-integer.t
--- old/JSON-Validator-3.07/t/jv-integer.t 2019-04-04 18:41:08.000000000
+0200
+++ new/JSON-Validator-3.08/t/jv-integer.t 2019-04-06 10:02:47.000000000
+0200
@@ -18,7 +18,7 @@
$schema->{properties}{mynumber}{multipleOf} = 2;
validate_ok {mynumber => 3}, $schema, E('/mynumber', 'Not multiple of 2.');

-jv->coerce(numbers => 1);
+jv->coerce('num');
validate_ok {mynumber => '2'}, $schema;
validate_ok {mynumber => '2xyz'}, $schema,
E('/mynumber', 'Expected integer - got string.');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/jv-number.t
new/JSON-Validator-3.08/t/jv-number.t
--- old/JSON-Validator-3.07/t/jv-number.t 2019-04-04 18:41:08.000000000
+0200
+++ new/JSON-Validator-3.08/t/jv-number.t 2019-04-06 10:02:47.000000000
+0200
@@ -11,7 +11,7 @@
validate_ok {mynumber => '2'}, $schema,
E('/mynumber', 'Expected number - got string.');

-jv->coerce(numbers => 1);
+jv->coerce('numbers');
validate_ok {mynumber => '-0.3'}, $schema;
validate_ok {mynumber => '0.1e+1'}, $schema;
validate_ok {mynumber => '2xyz'}, $schema,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JSON-Validator-3.07/t/jv-string.t
new/JSON-Validator-3.08/t/jv-string.t
--- old/JSON-Validator-3.07/t/jv-string.t 2019-04-04 18:41:08.000000000
+0200
+++ new/JSON-Validator-3.08/t/jv-string.t 2019-04-06 10:02:47.000000000
+0200
@@ -24,7 +24,7 @@
delete $schema->{properties}{nick}{pattern};
validate_ok {nick => 'Déjà vu'}, $schema;

-jv->coerce(1);
+jv->coerce('str');
validate_ok {nick => 1000}, $schema;

# https://github.com/mojolicious/json-validator/issues/134


< Previous Next >
This Thread