Open akarelas opened 1 month ago
I can't take the change, since too many tests fail.
We need to find out why those tests fail. Would they fail on any PR (even adding a blank line in a file)? If so, it's really a problem not to be attributed to me. If not, then I need to look at it.
Summary
This PR allows newer Perls' (v5.36+) builtin core booleans to be validated as booleans. It's quite a necessary change to make, as when you include the line
use v5.40
in your code file, you may not replace the meaning oftrue
andfalse
from perl's core booleans just by writinguse Mojo::JSON 'true', 'false';
. Therefore, it seems, core booleans need to be considered valid by all CPAN modules.I did it by modifying slightly the
JSON::Validator::Util::is_bool
function, inspired by howJSON::PP
recently achieved the same effect.Motivation
My motivation was to resolve this bug of Mojolicious::Plugin::OpenAPI: https://github.com/jhthorsen/mojolicious-plugin-openapi/issues/252
Tried my solution
I tested my modifications on a test Mojolicious website that uses Mojolicious::Plugin::OpenAPI, using both perl v5.34 (that doesn't have the builtin booleans) and perl v5.40 (that does), and the site works in both these cases.
I forgot to run
prove -vl
on it, or write tests with core booleans that will run only on perl v5.40. I will do so later today or tomorrow.References