openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Typescript-axios : Serialize array/multivalue parameters as repeat params, not CSV

Open TheGeekPharaoh opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe.

I have a defined OpenApi spec with a PUT method that takes an array of Strings as one of its request body parameters. The server that is accepting the request expects the parameters to be passed like:

param=Value1&param=Value2&param=Value3

The typescript-axios generator, however, serializes the request body parameters for an Array to a CSV format. As a result, the server receives a value like:

param=Value1%2CValue2%2CValue3

As a result, the parameters are not being deserialized and read properly on the server side

Describe the solution you'd like

A configuration parameter that would allow the Array to be serializes as a multi-valued parameter for both query parameters or form body parameters

TheGeekPharaoh avatar Apr 11 '24 21:04 TheGeekPharaoh