Blob Blame History Raw
From 073c636002cb9c19bba16389e882f1bf4ab23fb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 4 Dec 2018 12:52:28 +0100
Subject: [PATCH] Support JSON::XS 4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

JSON::XS 4 has the same API as version 3. It only enables allow_nonref
by default.

CPAN RT#127753

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 lib/JSON/Any.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/JSON/Any.pm b/lib/JSON/Any.pm
index a8a607e..11a4928 100644
--- a/lib/JSON/Any.pm
+++ b/lib/JSON/Any.pm
@@ -220,6 +220,10 @@ BEGIN {
     $conf{json_xs_3} = { %{ $conf{json_xs_2} } };
     $conf{json_xs_3}{get_true}  = sub { return Types::Serialiser::true(); };
     $conf{json_xs_3}{get_false} = sub { return Types::Serialiser::false(); };
+
+    # JSON::XS 4 is almost the same as JSON::XS 3. It only enables
+    # allow_nonref by default.
+    $conf{json_xs_4} = { %{ $conf{json_xs_3} } };
 }
 
 sub _make_key {
-- 
2.17.2