pplu / aws-sdk-perl

A community AWS SDK for Perl Programmers
Other
171 stars 94 forks source link

ES.DescribeElasticsearchDomain fails #418

Open eserte opened 3 years ago

eserte commented 3 years ago

The following oneliner fails:

$ env AWS_CONFIG_FILE=... perl -MData::Dumper -MPaws -e 'my $x = Paws->service("ES", region => "eu-central-1"); warn Dumper($x->DescribeElasticsearchDomain(DomainName => "..."))'
Not an ARRAY reference at /opt/perl-5.30.3/lib/site_perl/5.30.3/Paws/Net/RestJsonResponse.pm line 145.

The failing line is

145:                    $args{ $att } = $att_class->new(map { ($_->{ $xml_keys } => $_->{ $xml_values }) } @$value);

The debugger shows that $value is a HASH reference, not an ARRAY reference. $key at this point is "LogPublishingOptions".

Prajithp commented 3 years ago

@pplu Do we really need Paws::API::MapParser role for restjson enum class? since the response will be in HashRef instead of ArrayRef.

I managed to fix this by removing the role from the generated class.