OpenAPITools / OpenAPITools/openapi-generator
[BUG] Typescript - Multiple imports missing comma
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
Description
The following yaml file has multiple instances where two exports are import into the same file:
eg:
import { this that } from "./example.ts";
Problem being, the comma is missing in the above example, for instance the correctly generated code should be:
import { this, that } from "./example.ts";
openapi-generator version
Latest npm version
Steps to reproduce
- Download the code snippet above in the description
- npx @openapitools/openapi-generator-cli generate -i beacon-node-oapi.yaml -g typescript-node -o ./generated-source
- Navigate to
generated-typescript/api/beaconApi.tsline 37.
You should see:
import { String AnyType } from '../model/string AnyType';
There are other instances of this, but this one stands out.
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
Run the provided openapi-generator command against beacon-node-oapi.yaml and inspect generated-typescript/api/beaconApi.ts around line 37. Trace the TypeScript generator or template responsible for imports; done means generated imports contain commas between multiple names, including the String and AnyType example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100