|
2 | 2 | * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
3 | 3 | */
|
4 | 4 |
|
5 |
| -import {ParamDecorator, parseParamDecorator, populateFromGlobals, valToString} from "./utils"; |
| 5 | +import {ParamDecorator, parseParamDecorator, populateFromGlobals, shouldQueryParamSerialize, valToString} from "./utils"; |
6 | 6 |
|
7 | 7 | import {requestMetadataKey} from "./requestbody";
|
8 | 8 |
|
@@ -102,7 +102,7 @@ function noExplodeSerializer(params: Record<string, any>, delimiter = ","): stri
|
102 | 102 | const query: string[] = [];
|
103 | 103 |
|
104 | 104 | Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
|
105 |
| - if (!value) return; |
| 105 | + if (!shouldQueryParamSerialize(value)) return; |
106 | 106 | if (value !== Object(value))
|
107 | 107 | query.push(`${key}=${encodeURIComponent(valToString(value))}`);
|
108 | 108 | else if (Array.isArray(value)) {
|
@@ -141,7 +141,7 @@ function formSerializerExplode(params: Record<string, any>): string {
|
141 | 141 | const query: string[] = [];
|
142 | 142 |
|
143 | 143 | Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
|
144 |
| - if (!value) return; |
| 144 | + if (!shouldQueryParamSerialize(value)) return; |
145 | 145 | if (value !== Object(value))
|
146 | 146 | query.push(`${key}=${encodeURIComponent(value)}`);
|
147 | 147 | else if (Array.isArray(value)) {
|
@@ -184,7 +184,7 @@ function deepObjectSerializer(params: Record<string, any>): string {
|
184 | 184 | const query: string[] = [];
|
185 | 185 |
|
186 | 186 | Object.entries(Object.assign({}, params)).forEach(([key, value]) => {
|
187 |
| - if (!value) return; |
| 187 | + if (!shouldQueryParamSerialize(value)) return; |
188 | 188 | if (value !== Object(value))
|
189 | 189 | query.push(`${key}=${encodeURIComponent(value)}`);
|
190 | 190 | else if (Array.isArray(value)) {
|
|
0 commit comments