OpenAPITools / OpenAPITools/openapi-generator
[BUG] [typescript-fetch] Readonly properties are being Omitted in the wrong case
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
The generator emits objects with camelCase properties, but in cases where they should be omitted for being readonly, it omits them by snake_case, which is incorrect.
The issue was introduced in this change:
Omit readOnly properties from request models
The problem is visible in the sample output:
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts#L73
Name has a property snakeCase, but the generator outputs Omit<Name, "snake_case">.
openapi-generator version
7.5.0
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 generated sample at samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts and compare the snakeCase property declaration with its Omit type. Read the linked “Omit readOnly properties from request models” change to trace the generator path. Done means readonly omission uses the camelCase property name in generated TypeScript output, with regression coverage if the existing generator tests identify a suitable entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100