You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Condition typeof query[key] === "object" && !Array.isArray(query[key]) incorrectly handles primitive types: if type of query[key] is, for example, number, it will be handled by the this.addArrayQueryParam method, which is incorrect, and will throw an exception further on this line:
private addArrayQueryParam(query: QueryParamsType, key: string) {
const value = query[key];
const encodedKey = encodeURIComponent(key);
return `${value.map((val: any) => `${encodedKey}=${encodeURIComponent(typeof val === "number" ? val : `${val}`)}`).join('&')}`;
}
Since type of value is number, obviously it's doesn't have .map method and the code will break.
The text was updated successfully, but these errors were encountered:
Hi team!
I believe that PR #223 has introduced a regression to the generated API query parameters serialization. The issue is in this template:
Condition
typeof query[key] === "object" && !Array.isArray(query[key])
incorrectly handles primitive types: if type ofquery[key]
is, for example,number
, it will be handled by thethis.addArrayQueryParam
method, which is incorrect, and will throw an exception further on this line:Since type of
value
isnumber
, obviously it's doesn't have.map
method and the code will break.The text was updated successfully, but these errors were encountered: