aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js (In Maintenance Mode, End-of-Life on 09/08/2025). The AWS SDK for JavaScript v3 in the browser and Node.js is available here: https://github.com/aws/aws-sdk-js-v3
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.6k stars 1.55k forks source link

fix: do not serialize empty lists in ec2 #4639

Closed kuhe closed 6 months ago

kuhe commented 6 months ago
kuhe commented 6 months ago

testing:

process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE = 1;

const AWS = require("../../lib/aws");

const ec2 = new AWS.EC2({
    region: "us-west-2",
});

const request = ec2.describeFleets({
    Filters: []
});

request.promise();

console.log(request.httpRequest.body);

this logs Action=DescribeFleets&Version=2016-11-15 with the fix, as is intended.

this logs Action=DescribeFleets&Filter=&Version=2016-11-15 without the fix, and the request fails.