Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions templates/requestBuilder.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,21 @@ class QueryParameter extends Parameter {
// Append a parameter for each key, in the form `name[key]`
for (const key of Object.keys(this.value)) {
const propVal = this.value[key];
if (propVal !== null && propVal !== undefined) {
params = params.append(`${this.name}[${key}]`, this.serializeValue(propVal));
if (propVal !== null && typeof propVal === 'object') {
for (const keyD of Object.keys(propVal)) {
const propValDeep = this.value[key][keyD];
if (propValDeep !== null && propValDeep !== undefined) {
params = params.append(
`${this.name}[${key}][${keyD}]`,
this.serializeValue(propValDeep)
);
}
}
} else if (propVal !== null && propVal !== undefined) {
params = params.append(
`${this.name}[${key}]`,
this.serializeValue(propVal)
);
}
}
} else if (this.options.explode) {
Expand All @@ -177,8 +190,7 @@ class QueryParameter extends Parameter {
}
} else if (this.value !== null && this.value !== undefined) {
// Plain value
params = this.value;
//params = params.append(this.name, this.serializeValue(this.value));
params = params.append(this.name, this.serializeValue(this.value));
}
return params;
}
Expand Down