Skip to content

[BUG][Typescript/Axios] openApi generator does not generate Interfaces but Types. Not possible to use Extends. #15022

@scainMauricio

Description

@scainMauricio

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
Description

When using the openapi-generator-cli for Typescript-Axios with separated folders for Models and API the Models, they are being generated as Type instead of Interface. Some of my models should have Extends, so it's not working. (images below)
If I generate everything in the same folder, then it generates as Interfaces and it works, but I'd not like that because it's over 4k lines.

It also works correctly for typescript-angular. So it's something related to Typescript-Axios with separated folders for Model/API

openapi-generator version

@openapitools/openapi-generator-cli@2.5.2

Generation Details

I will put line by line so its more readable

generate -i codegen-swagger-api.yaml -g typescript-axios -o .\backendAPIs%LIB%\src\lib
--model-name-suffix=API
--additional-properties modelPropertyNaming=original
--additional-properties serviceSuffix=ServiceAPI
--additional-properties useSingleRequestParameter=true
--additional-properties supportsES6=true
--additional-properties withSeparateModelsAndApi=true
--additional-properties modelPackage=models
--additional-properties apiPackage=api

###Current
image

Expected

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions