openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[BUG] Models are incomplete when using typescript-axios withSeparateModelsAndApi

Open leomcpugo opened this issue 2 years ago • 1 comments

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

openapi.json

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

leomcpugo avatar Oct 15 '23 00:10 leomcpugo

Unfortunately this issue is still happening :/

stevaras avatar May 10 '24 10:05 stevaras