OpenAPITools / OpenAPITools/openapi-generator
[BUG] Typescript generator ignores disallowAdditionalPropertiesIfNotPresent
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
The types it generates doesnt include the additionalProperties object even though it should exist for the request im sending.
I tested the same openAPI file with the Java generator and it works perfectly fine with the additional fields included in the returned object.
openapi-generator version
7.19.0
OpenAPI declaration file content or url
https://openapi.bamboohr.io/main/latest/docs/openapi/public-openapi.yaml
##### Generation Details
openapi-generator-cli generate
-i https://openapi.bamboohr.io/main/latest/docs/openapi/public-openapi.yaml
-g typescript-fetch
-o ~/code/bambooAPI-ts
--additional-properties=disallowAdditionalPropertiesIfNotPresent=false,nullSafeAdditionalProps=true;
##### Steps to reproduce
use the typescript-fetch generator
openapi-generator-cli generate
-i https://openapi.bamboohr.io/main/latest/docs/openapi/public-openapi.yaml
-g typescript-fetch
-o ~/code/bambooAPI-ts
--additional-properties=disallowAdditionalPropertiesIfNotPresent=false,nullSafeAdditionalProps=true;
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 reproducing the issue with the provided BambooHR OpenAPI URL and the typescript-fetch generation command, then trace how disallowAdditionalPropertiesIfNotPresent and nullSafeAdditionalProps are handled by that generator. Done means generated types include the expected additionalProperties object when the option is false, with coverage or a verified reproduction demonstrating the behavior.
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
- Mostly clear
- Newbie friendliness
- 42/100