OpenAPITools / OpenAPITools/openapi-generator

[BUG] typescript angular - parameters with style spaceDelimited generating csv

Open
#5,630 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • [X ] Have you search for related issues/PRs?

What's the actual output vs expected output?

given a header param defined as :

{
"in": "header",
"name": "Range",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "string"
}
},
"style": "spaceDelimited"
}

and calling the generated method in ts angular with:

genMethod(["foo", "0","100"])

#expected header:
Range: items 0 100

#actual header
Range: items,0,100

Description

When specifying "style": "spaceDelimited" for a request header it is generated as csv.

openapi-generator version

docker image
Using default tag: latest
latest: Pulling from openapitools/openapi-generator-cli
Digest: sha256:c1fa5d28b09e44889b4cc05138790343b4531687d5f20cdc5db175a7842d40c9

OpenAPI declaration file content or url

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 reproducing the supplied OpenAPI header parameter with the TypeScript Angular generator, then inspect the generated service's COLLECTION_FORMATS mapping and parameter serialization. Done means a spaceDelimited array produces Range: items 0 100 rather than comma-separated values.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.