Skip to content

Commit 26dd31b

Browse files
committed
fix: correct query parameter handling in client generator
Modify query parameter mapping to use bracket notation for dynamic property access, ensuring proper parameter serialization in generated Axios methods
1 parent 7107ef0 commit 26dd31b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generator/clientGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function generateAxiosMethod(operation: OperationInfo, spec: OpenAPIV3.Document)
127127
`const url = \`${urlWithParams}\`;`,
128128
queryParams.length > 0
129129
? `const queryData = {
130-
${queryParams.map((p) => `${p.name}: data.${p.name}`).join(",\n ")}
130+
${queryParams.map((p) => `["${p.name}"]: data["${p.name}"]`).join(",\n ")}
131131
};`
132132
: "",
133133
requestBodySchema?.properties

0 commit comments

Comments
 (0)