about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/HTTP/API/Parser/JSON.pm11
-rw-r--r--lib/Net/HTTP/API/Role/Authentication.pm2
-rw-r--r--lib/Net/HTTP/API/Role/Serialization.pm2
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/Net/HTTP/API/Parser/JSON.pm b/lib/Net/HTTP/API/Parser/JSON.pm
index be8b30e..2edc71c 100644
--- a/lib/Net/HTTP/API/Parser/JSON.pm
+++ b/lib/Net/HTTP/API/Parser/JSON.pm
@@ -6,14 +6,21 @@ use JSON;
 use Moose;
 extends 'Net::HTTP::API::Parser';
 
+has _json_parser => (
+    is      => 'rw',
+    isa     => 'JSON',
+    lazy    => 1,
+    default => sub { JSON->new->allow_nonref },
+);
+
 sub encode {
     my ($self, $content) = @_;
-    return JSON::encode_json($content);
+    $self->_json_parser->encode($content);
 }
 
 sub decode {
     my ($self, $content) = @_;
-    return JSON::decode_json($content);
+    $self->_json_parser->decode($content);
 }
 
 1;
diff --git a/lib/Net/HTTP/API/Role/Authentication.pm b/lib/Net/HTTP/API/Role/Authentication.pm
index 27728c3..97150c4 100644
--- a/lib/Net/HTTP/API/Role/Authentication.pm
+++ b/lib/Net/HTTP/API/Role/Authentication.pm
@@ -63,5 +63,3 @@ after BUILDALL => sub {
 =item B<api_username>
 
 =back
-64:	hit eof while in pod documentation (no =cut seen)
-	this can cause trouble with some pod utilities
diff --git a/lib/Net/HTTP/API/Role/Serialization.pm b/lib/Net/HTTP/API/Role/Serialization.pm
index 37d2603..ee98800 100644
--- a/lib/Net/HTTP/API/Role/Serialization.pm
+++ b/lib/Net/HTTP/API/Role/Serialization.pm
@@ -100,5 +100,3 @@ sub _load_serializer {
 =item B<deserialize>
 
 =back
-99:	hit eof while in pod documentation (no =cut seen)
-	this can cause trouble with some pod utilities