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';
7
7
requires ' URI' ;
8
8
requires ' Net::Amazon::Signature::V4' ;
9
9
requires ' JSON::MaybeXS' ;
10
- requires ' XML::Hash::XS' ;
10
+ requires ' XML::Hash::XS' , ' >= 0.54 ' ; # 0.54 introduces suppress_empty option
11
11
requires ' IO::Socket::SSL' ;
12
12
requires ' DateTime' ;
13
13
requires ' DateTime::Format::ISO8601' ;
Original file line number Diff line number Diff line change 1
1
package Paws::Net::RestXMLResponse ;
2
2
use Moose;
3
- use XML::Hash::XS qw/ / ;
3
+ use XML::Hash::XS 0.54 qw/ / ; # 0.54 introduces suppress_empty option
4
4
use Carp qw( croak) ;
5
5
use HTTP::Status;
6
6
use Paws::Exception;
@@ -12,6 +12,7 @@ package Paws::Net::RestXMLResponse;
12
12
13
13
my $xml = XML::Hash::XS-> new(
14
14
force_array => qr / ^(?:item|Errors)/ i ,
15
+ suppress_empty => undef ,
15
16
);
16
17
return $xml -> xml2hash($data );
17
18
}
Original file line number Diff line number Diff line change 1
1
package Paws::Net::XMLResponse ;
2
2
use Moose;
3
- use XML::Hash::XS qw/ / ;
3
+ use XML::Hash::XS 0.54 qw/ / ; # 0.54 introduces suppress_empty option
4
4
5
5
use Carp qw( croak) ;
6
6
use Paws::Exception;
@@ -9,7 +9,7 @@ package Paws::Net::XMLResponse;
9
9
default => sub {
10
10
return XML::Hash::XS-> new(
11
11
force_array => qr / ^(?:item|Errors)/ i ,
12
- # SuppressEmpty => undef,
12
+ suppress_empty => undef ,
13
13
);
14
14
}
15
15
);
@@ -27,7 +27,6 @@ package Paws::Net::XMLResponse;
27
27
}
28
28
29
29
my $struct = eval { $self -> _xml_parser-> xml2hash($response -> content) };
30
- $struct = _emulate_xml_simple_supress_empty($struct );
31
30
if ($@ ){
32
31
return Paws::Exception-> throw(
33
32
message => $@ ,
@@ -39,20 +38,6 @@ package Paws::Net::XMLResponse;
39
38
return $struct ;
40
39
}
41
40
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
-
56
41
sub process {
57
42
my ($self , $call_object , $response ) = @_ ;
58
43
You can’t perform that action at this time.
0 commit comments