File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +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
13
);
13
14
}
14
15
);
@@ -26,6 +27,7 @@ package Paws::Net::XMLResponse;
26
27
}
27
28
28
29
my $struct = eval { $self -> _xml_parser-> xml2hash($response -> content) };
30
+ $struct = _emulate_xml_simple_supress_empty($struct );
29
31
if ($@ ){
30
32
return Paws::Exception-> throw(
31
33
message => $@ ,
@@ -37,6 +39,20 @@ package Paws::Net::XMLResponse;
37
39
return $struct ;
38
40
}
39
41
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
+
40
56
sub process {
41
57
my ($self , $call_object , $response ) = @_ ;
42
58
You can’t perform that action at this time.
0 commit comments