OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Typescript] generation with --global-properties=model produced code that doesn't compile
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Using 5.0.0.beta2 when generating code with --global-properties model all models contain import import { HttpFile } from '../http/http'; to file which doesn't exist because api service aren't generated.
When api service are generated, import in models isn't used when model doesn't handle fileUpload.
npx @openapitools/openapi-generator-cli generate -i src/main/resources/swagger/api.yml -g typescript -o src/main/webapp/app/models --global-property models --additional-properties=stringEnums=true -c openapitools.json
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 the reported OpenAPI Generator CLI command with --global-property models and inspect the generated model imports. Compare generation with and without API services, then verify that models without file uploads do not reference the missing ../http/http file and that the generated TypeScript compiles.
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
- 35/100