Skip to content

Commit 5c2e538

Browse files
committed
chore(protocol_tests): simplify request query string for httpQueryParams trait
1 parent 88b99e8 commit 5c2e538

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

protocol_tests/aws-restjson/protocols/Aws_restJson1.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,7 @@ export const serializeAws_restJson1AllQueryStringTypesCommand = async (
150150
const headers: any = {};
151151
let resolvedPath = "/AllQueryStringTypesInput";
152152
const query: any = {
153-
...(input.queryParamsMapOfStrings !== undefined &&
154-
Object.entries(input.queryParamsMapOfStrings || {}).reduce(
155-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
156-
{}
157-
)),
153+
...(input.queryParamsMapOfStrings !== undefined && input.queryParamsMapOfStrings),
158154
...(input.queryString !== undefined && { String: input.queryString }),
159155
...(input.queryStringList !== undefined && { StringList: (input.queryStringList || []).map((_entry) => _entry) }),
160156
...(input.queryStringSet !== undefined && {
@@ -1238,11 +1234,7 @@ export const serializeAws_restJson1QueryParamsAsStringListMapCommand = async (
12381234
const headers: any = {};
12391235
let resolvedPath = "/StringListMap";
12401236
const query: any = {
1241-
...(input.foo !== undefined &&
1242-
Object.entries(input.foo || {}).reduce(
1243-
(acc: any, [key, value]: [string, string[]]) => ({ ...acc, [key]: (value || []).map((_entry) => _entry) }),
1244-
{}
1245-
)),
1237+
...(input.foo !== undefined && input.foo),
12461238
...(input.qux !== undefined && { corge: input.qux }),
12471239
};
12481240
let body: any;
@@ -1266,11 +1258,7 @@ export const serializeAws_restJson1QueryPrecedenceCommand = async (
12661258
const headers: any = {};
12671259
let resolvedPath = "/Precedence";
12681260
const query: any = {
1269-
...(input.baz !== undefined &&
1270-
Object.entries(input.baz || {}).reduce(
1271-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
1272-
{}
1273-
)),
1261+
...(input.baz !== undefined && input.baz),
12741262
...(input.foo !== undefined && { bar: input.foo }),
12751263
};
12761264
let body: any;

protocol_tests/aws-restxml/protocols/Aws_restXml.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ export const serializeAws_restXmlAllQueryStringTypesCommand = async (
173173
const headers: any = {};
174174
let resolvedPath = "/AllQueryStringTypesInput";
175175
const query: any = {
176-
...(input.queryParamsMapOfStrings !== undefined &&
177-
Object.entries(input.queryParamsMapOfStrings || {}).reduce(
178-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
179-
{}
180-
)),
176+
...(input.queryParamsMapOfStrings !== undefined && input.queryParamsMapOfStrings),
181177
...(input.queryString !== undefined && { String: input.queryString }),
182178
...(input.queryStringList !== undefined && { StringList: (input.queryStringList || []).map((_entry) => _entry) }),
183179
...(input.queryStringSet !== undefined && {
@@ -1153,11 +1149,7 @@ export const serializeAws_restXmlQueryParamsAsStringListMapCommand = async (
11531149
const headers: any = {};
11541150
let resolvedPath = "/StringListMap";
11551151
const query: any = {
1156-
...(input.foo !== undefined &&
1157-
Object.entries(input.foo || {}).reduce(
1158-
(acc: any, [key, value]: [string, string[]]) => ({ ...acc, [key]: (value || []).map((_entry) => _entry) }),
1159-
{}
1160-
)),
1152+
...(input.foo !== undefined && input.foo),
11611153
...(input.qux !== undefined && { corge: input.qux }),
11621154
};
11631155
let body: any;
@@ -1181,11 +1173,7 @@ export const serializeAws_restXmlQueryPrecedenceCommand = async (
11811173
const headers: any = {};
11821174
let resolvedPath = "/Precedence";
11831175
const query: any = {
1184-
...(input.baz !== undefined &&
1185-
Object.entries(input.baz || {}).reduce(
1186-
(acc: any, [key, value]: [string, string]) => ({ ...acc, [key]: value }),
1187-
{}
1188-
)),
1176+
...(input.baz !== undefined && input.baz),
11891177
...(input.foo !== undefined && { bar: input.foo }),
11901178
};
11911179
let body: any;

0 commit comments

Comments
 (0)