jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

Bugfix: use time local #163

Closed augensalat closed 5 years ago

augensalat commented 5 years ago

Summary

Date/time checks in JSON::Validator::Formats are failing because Time::Local is not loaded.

Motivation

Because it must not fail.

References

I added a min-test for demonstration.

jhthorsen commented 5 years ago

I don't understand what you're saying. I run prove -vl t/jv-formats.t and it works nicely. Can you explain how to reproduce the problem?

augensalat commented 5 years ago

I don't understand what you're saying. I run prove -vl t/jv-formats.t and it works nicely. Can you explain how to reproduce the problem?

t/jv-formats.t does not test JSON::Validator::Formats - as none of the other tests does.

Checkout the first commit of this branch and run the test I wrote for JSON::Validator::Formats:

git checkout 28fe085
prove -vl t/formats.t

Or straight to the point:

git checkout master
perl -Ilib -MJSON::Validator::Formats -wE 'say JSON::Validator::Formats::check_date("2019-06-12")'
jhthorsen commented 5 years ago

So you're using JSON::Validator::Formats, without using JSON::Validator?

augensalat commented 5 years ago

So you're using JSON::Validator::Formats, without using JSON::Validator?

Does your question imply that J:V:Formats is an internal module? Then you should remove the documentation, or at least include a big DONT-USE-notice.

My answer is: Yes and No.

Yes, because actually I wanted to report another issue in this module (that affects JSON::Validator), and then found out, that it is even more broken.

And No, because I do not use it anywhere directly.

Whatever. The use Time::Local is in the wrong file. I just want this to be fixed before I report the actual problem.

augensalat commented 5 years ago

Two weeks passed - nothing happened. Is there a chance to make progress on the subject?