aws-sdk-perl icon indicating copy to clipboard operation
aws-sdk-perl copied to clipboard

Paws::Route53::ListResourceRecordSets -- HostedZoneId not being passed through to request

Open pjlsergeant opened this issue 9 years ago • 3 comments

For some reason, this:

  has HostedZoneId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'Id' , required => 1);

isn't being picked up by:

  class_has _api_uri  => (isa => 'Str', is => 'ro', default => '/2013-04-01/hostedzone/{Id}/rrset');

Also, the Id as returned by:

->ListHostedZones()->HostedZones()

Already has the string hostedzone/ prefixed.

To get around this I'm using the local hotfix in my code, but a real solution would be preferable 😂

{
    use Paws::Route53::ListResourceRecordSets;
    my $mop = Paws::Route53::ListResourceRecordSets->meta;
    $mop->add_attribute(
        Id => (
            is         => 'ro',
            isa        => 'Str',
            lazy_build => 1,
            traits     => ['ParamInURI'],
            uri_name   => 'Id'
        )
    );
    $mop->add_method(
        _build_Id => sub {
            my $self = shift;
            my $id   = $self->HostedZoneId;
            $id =~ s!.+/!!;
            return $id;
        }
    );
}

pjlsergeant avatar Nov 10 '16 00:11 pjlsergeant

Hi!

Thanks for your bug report! I'll take a look at fixing this so you don't have to apply this patch.

BTW: I love the way you've patched the class 😄

pplu avatar Nov 11 '16 12:11 pplu

It looks like this issue should already be fixed by the #164 PR ?

castaway avatar Jun 06 '18 11:06 castaway

Tests in t/route53/uri_generation.t added in tests/stabilisation for this - now passing

castaway avatar Jan 28 '20 12:01 castaway