Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Fix handling of empty values for required list parameters #49

Closed
wants to merge 1 commit into from

Conversation

AKoetsier
Copy link

The command ElasticLoadBalancing#set_load_balancer_policies_of_listener has a required parameter policy_names which is defined as a list of policy names (list of strings). The documentation for this option states:

List of policies to be associated with the listener. Currently this list can have at most one policy. If the list is empty, the current policy is removed from the listener.

If you supply an empty array for the value an exception will be thrown:

Aws::ElasticLoadBalancing::Errors::ValidationError (1 validation error detected: Value null at 'policyNames' failed to satisfy constraint: Member must not be null)

This change allows you to pass an empty array.

@trevorrowe
Copy link
Contributor

Sorry for the slow response on this PR. I think the basic solution is correct, but I think it needs to go a step further and always serialize empty lists. I audited the aws-sdk gem to ensure this behavior is consistent.

There is a small bug in the commit. It uses the prefix, split on a dot character, first part. Lists can be deeply nested in structure, e.g. Foo.Bar.Yuck.ListMemberName. The empty serialization would truncate this down toFoo`.

I'm going to put together a patch. I'll make sure this patch closes this PR so you can track its completion.

Thank you for reporting this bug and doing the initial leg work!

trevorrowe added a commit that referenced this pull request Jun 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants