OpenAPITools / OpenAPITools/openapi-generator

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

Open
#18,367 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the typescript-axios generator's serialization logic for query parameters and form body parameters. Reproduce the issue with an OpenAPI operation containing an array of strings, then determine how configuration should produce repeated param=Value entries instead of CSV output and verify both parameter locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.