OpenAPITools / OpenAPITools/openapi-generator
[BUG] [typescript] lacks support for parameters serialization with array and object values
Nobody has claimed this yet.
- 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
Current implementation of path, query and header parameters serialization has support only for primitive values.
openapi-generator version
Tested 7.1.0 and master. Not a regression.
OpenAPI declaration file content or url
paths:
/some-path/{foo}/{bar}:
parameters:
- in: path
name: foo
required: true
schema:
type: array
items:
type: string
- in: path
name: bar
required: true
schema:
type: object
properties:
baz:
type: string
- in: query
name: qux
required: true
schema:
type: array
items:
type: string
- in: query
name: quux
required: true
schema:
type: object
properties:
baz:
type: string
- in: header
name: quux
required: true
schema:
type: object
properties:
baz:
type: string
Generation Details
openapi-generator-cli generate --generator-name="typescript" --additional-properties="enumPropertyNaming=original,modelPropertyNaming=original"
Related issues/PRs
- https://github.com/OpenAPITools/openapi-generator/issues/12329
- https://github.com/OpenAPITools/openapi-generator/issues/9003
Suggest a fix
Properly implement spec with proper support for style and explode options.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TypeScript generator entry point used by the supplied openapi-generator-cli command, then trace serialization for path, query, and header parameters. Reproduce the issue with the provided OpenAPI YAML, focusing on array and object values and their style/explode options. Done means generated TypeScript clients serialize these parameters according to the OpenAPI specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, 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