OpenAPITools / OpenAPITools/openapi-generator

[BUG] [typescript-angular] queryParamObjectFormat=key doesn't work correctly after v7.11.0 on typescript-angular generator

Open
#21,182 2 comments 7 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
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Starting from v7.12.0, the angular-typescript generator makes invalid web requests :

v7.11.0:
It was working correctly.
?limit=25&offset=0&filter%5Bterms%5D=&filter%5Bmember%5D=1&filter%5BconnectionType%5D=wireless
-> ?limit=25&offset=0&filter[terms]=&filter[member]=1&filter[connectionType]=wireless

v7.12.0:
The parameter queryParamObjectFormat was completely ignored and the json format was used.
?limit=25&offset=0&filter=%7B%22terms%22%3A%22%22%2C%22member%22%3A1%2C%22connectionType%22%3A%22wired%22%7D
-> ?limit=25&offset=0&filter={"terms":"","member":1,"connectionType":"wired"}

v7.13.0:
Everything is flat, and thus, wrong.
?limit=25&offset=0&terms=&member=1&connectionType=wired

This is a regression, it was correctly working on previous versions.
Something has changed between the v7.12.0 and v7.13.0 but there is still something wrong.

Generation Details

docker run --rm -u $(CURRENT_UID):$(CURRENT_GID) -v ${PWD}:/local openapitools/openapi-generator-cli:v7.13.0 generate -i /local/openapi/spec.yaml -g typescript-angular -o "/local/frontend_angular/src/app/api" --additional-properties=queryParamObjectFormat=key

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 with the typescript-angular generation command in the report and compare generated client requests between v7.11.0, v7.12.0, and v7.13.0 using queryParamObjectFormat=key. Trace the generated query-parameter serialization, then verify that nested object keys produce the expected bracketed query format rather than JSON or flattened parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.