Skip to content

Commit

Permalink
don't serialize empty lists in ec2query
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed May 21, 2024
1 parent 4c997a5 commit 5e331e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
### SDK Enhancements

### SDK Bugs
* `service/ec2`: Correct empty list serialization behavior.
* Empty, non-nil lists should NOT be serialized for this service.
4 changes: 2 additions & 2 deletions private/protocol/query/queryutil/queryutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
}

func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value
if !value.IsNil() && value.Len() == 0 {
// If it's empty, and not ec2, generate an empty value
if !value.IsNil() && value.Len() == 0 && !q.isEC2 {
v.Set(prefix, "")
return nil
}
Expand Down

0 comments on commit 5e331e3

Please sign in to comment.