diff --git a/cpanfile b/cpanfile index b81abe1c5c..fb58c3e4cf 100644 --- a/cpanfile +++ b/cpanfile @@ -7,7 +7,7 @@ requires 'Data::Compare'; requires 'URI'; requires 'Net::Amazon::Signature::V4'; requires 'JSON::MaybeXS'; -requires 'XML::Hash::XS'; +requires 'XML::Hash::XS', '>= 0.54'; # 0.54 introduces suppress_empty option requires 'IO::Socket::SSL'; requires 'DateTime'; requires 'DateTime::Format::ISO8601'; diff --git a/lib/Paws/Net/RestXMLResponse.pm b/lib/Paws/Net/RestXMLResponse.pm index 92ab6e8130..cf1077e78f 100644 --- a/lib/Paws/Net/RestXMLResponse.pm +++ b/lib/Paws/Net/RestXMLResponse.pm @@ -1,6 +1,6 @@ package Paws::Net::RestXMLResponse; use Moose; - use XML::Hash::XS qw//; + use XML::Hash::XS 0.54 qw//; # 0.54 introduces suppress_empty option use Carp qw(croak); use HTTP::Status; use Paws::Exception; @@ -12,6 +12,7 @@ package Paws::Net::RestXMLResponse; my $xml = XML::Hash::XS->new( force_array => qr/^(?:item|Errors)/i, + suppress_empty => undef, ); return $xml->xml2hash($data); } diff --git a/lib/Paws/Net/XMLResponse.pm b/lib/Paws/Net/XMLResponse.pm index 11c4a54103..0e70601d7a 100644 --- a/lib/Paws/Net/XMLResponse.pm +++ b/lib/Paws/Net/XMLResponse.pm @@ -1,6 +1,6 @@ package Paws::Net::XMLResponse; use Moose; - use XML::Hash::XS qw//; + use XML::Hash::XS 0.54 qw//; # 0.54 introduces suppress_empty option use Carp qw(croak); use Paws::Exception; @@ -9,6 +9,7 @@ package Paws::Net::XMLResponse; default => sub { return XML::Hash::XS->new( force_array => qr/^(?:item|Errors)/i, + suppress_empty => undef, ); } );