Skip to content

Support array member names #197

@mpraski

Description

@mpraski

First of all thank you for this wonderful library!

I've been using it to communicate with the SES API, specifically the get_identity_verification_attributes call, and it seems that current body encoder is not handling certain requests in accordance with the spec.

The call:

AWS.SES.get_identity_verification_attributes(client, %{"Identities" => ["example.com"]})

generates following request body:

Action=GetIdentityVerificationAttributes&Identities.1=example.com&Version=2010-12-01

This results in a HTTP 400 from AWS, which happens due to the array member naming convention of having the "member" in between the array name and the index:Identities.member.1=example.com rather than Identities.1=example.com. (See https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityVerificationAttributes.html)

AWS CDK for e.g. Golang factors in the member name in the array format (https://github.com/aws/aws-sdk-go-v2/blob/main/aws/protocol/query/array.go#L36), and I assume the AWS.Util.encode_query_value/1 would need to be made configurable to some extent to allow those member names globally/per API.

I'll do more research on this convention and gladly raise a PR to address this issue - suggestions are welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions