karenetheridge / JSON-Schema-Modern

Validate data against a schema using a JSON Schema
https://metacpan.org/release/JSON-Schema-Modern/
Other
10 stars 1 forks source link

Error: Can't locate object method "allow_bignum" via package "JSON::XS" #69

Closed full-of-joy closed 2 years ago

full-of-joy commented 2 years ago

I've encountered the following error: Can't locate object method "allow_bignum" via package "JSON::XS" at /usr/lib/perl5/vendor_perl/5.26.1/JSON/MaybeXS.pm line 50

Here's a test-script to reproduce it. I hope it helps. Test.zip

karenetheridge commented 2 years ago

You're using JSON.pm, which is loading JSON::XS, and JSON::XS doesn't support bignums. JSON::MaybeXS provides a much more sane JSON translation layer.

https://metacpan.org/pod/Perl::Critic::Policy::Community::DiscouragedModules#JSON::XS