OpenAPITools / OpenAPITools/openapi-generator
[BUG] typescript-node generates invalid code for 'api-key'
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)?
- [x<] What's the version of OpenAPI Generator used? 4.1.1
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
Description
- Download the following file https://directory-te.preta.eu/directory/static/directory/api/tppSwaggerApi.json
- Run
openapi-generator generate -i tppSwaggerApi.json -g typescript-node
Result: An invalid enum is generated.
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum TppApiApiKeys {
api-key,
}
Also, for some reason the response type is using response: http.ClientResponse which does not seem to work. When changed to response: localVarRequest.Response everything works as expected.
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 by running openapi-generator generate -i tppSwaggerApi.json -g typescript-node with the linked specification and inspect the generated TppApiApiKeys enum and response type. Trace the typescript-node generation path for these outputs; done means the generated enum is valid TypeScript and the response type works without manual changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100