openapi-generator
openapi-generator copied to clipboard
[BUG] Models are incomplete when using typescript-axios withSeparateModelsAndApi
Bug Report Checklist
- [x] Have you provided a full/minimal spec to reproduce the issue?
- [x] Have you validated the input using an OpenAPI validator (example)?
- [x] Have you tested with the latest master to confirm the issue still exists?
- [x] Have you searched for related issues/PRs?
- [x] What's the actual output vs expected output?
- [ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The models generated using typescript-axios with withSeparateModelsAndApi=true are incomplete.
Instead of using interfaces it's using only the base type and not considering the child properties.
The models are fully generated when using withSeparateModelsAndApi=false.
openapi-generator version
7.0.1
OpenAPI declaration file content or url
With withSeparateModelsAndApi:true
export type EmailAddressDTO = ContactDetailDTO;
With withSeparateModelsAndApi:false
export interface EmailAddressDTO extends ContactDetailDTO {
/**
*
* @type {string}
* @memberof EmailAddressDTO
*/
'emailAddress': string;
}
Generation Details
N/A
Steps to reproduce
I'm using the default command
npx openapi-generator-cli generate -g typescript-axios -i {input} -o {outpot} -c {config with withSeparateModelsAndApi}
Related issues/PRs
Could not find any
Suggest a fix
Check the generation of the Models in the withSeparateModelsAndApi:false and adapt it to when it's set to true
Unfortunately this issue is still happening :/