File tree Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ requires 'Data::Compare';
77requires ' URI' ;
88requires ' Net::Amazon::Signature::V4' ;
99requires ' JSON::MaybeXS' ;
10- requires ' XML::Hash::XS' ;
10+ requires ' XML::Hash::XS' , ' >= 0.54 ' ; # 0.54 introduces suppress_empty option
1111requires ' IO::Socket::SSL' ;
1212requires ' DateTime' ;
1313requires ' DateTime::Format::ISO8601' ;
Original file line number Diff line number Diff line change 11package Paws::Net::RestXMLResponse ;
22 use Moose;
3- use XML::Hash::XS qw/ / ;
3+ use XML::Hash::XS 0.54 qw/ / ; # 0.54 introduces suppress_empty option
44 use Carp qw( croak) ;
55 use HTTP::Status;
66 use Paws::Exception;
@@ -12,6 +12,7 @@ package Paws::Net::RestXMLResponse;
1212
1313 my $xml = XML::Hash::XS-> new(
1414 force_array => qr / ^(?:item|Errors)/ i ,
15+ suppress_empty => undef ,
1516 );
1617 return $xml -> xml2hash($data );
1718 }
Original file line number Diff line number Diff line change 11package Paws::Net::XMLResponse ;
22 use Moose;
3- use XML::Hash::XS qw/ / ;
3+ use XML::Hash::XS 0.54 qw/ / ; # 0.54 introduces suppress_empty option
44
55 use Carp qw( croak) ;
66 use Paws::Exception;
@@ -9,7 +9,7 @@ package Paws::Net::XMLResponse;
99 default => sub {
1010 return XML::Hash::XS-> new(
1111 force_array => qr / ^(?:item|Errors)/ i ,
12- # SuppressEmpty => undef,
12+ suppress_empty => undef ,
1313 );
1414 }
1515 );
@@ -27,7 +27,6 @@ package Paws::Net::XMLResponse;
2727 }
2828
2929 my $struct = eval { $self -> _xml_parser-> xml2hash($response -> content) };
30- $struct = _emulate_xml_simple_supress_empty($struct );
3130 if ($@ ){
3231 return Paws::Exception-> throw(
3332 message => $@ ,
@@ -39,20 +38,6 @@ package Paws::Net::XMLResponse;
3938 return $struct ;
4039 }
4140
42- sub _emulate_xml_simple_supress_empty {
43- my ($struct ) = @_ ;
44- return undef unless $struct ;
45- foreach (keys %$struct ) {
46- if (ref $struct -> {$_ } eq ' HASH' ) {
47- _emulate_xml_simple_supress_empty($struct -> {$_ })
48- }
49- elsif (defined $struct -> {$_ } && $struct -> {$_ } eq ' ' ) {
50- $struct -> {$_ } = undef ;
51- }
52- }
53- return $struct ;
54- }
55-
5641 sub process {
5742 my ($self , $call_object , $response ) = @_ ;
5843
You can’t perform that action at this time.
0 commit comments