Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [typescript-axios] withSeparateModelsAndApi Bad import of interface model - missing import type #17462

Closed
wants to merge 1 commit into from

Conversation

jmorille
Copy link

Bug Report Checklist

  • [X ] Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When generate open-api client with generatorName: typescript-axios, the template generate model like an interface model

export interface JmsDlqEventMessageJsonNode {
    /**
     * 
     * @type {string}
     * @memberof JmsDlqEventMessageJsonNode
     */
    'JMSMessageID'?: string;
    /**
     * 
     * @type {string}
     * @memberof JmsDlqEventMessageJsonNode
     */
    'JMSCorrelationID'?: string;

That work fine except if you are using the option withSeparateModelsAndApi=true
In this case the api class generate import without the type

 // @ts-ignore
 import { JmsDlqEventMessageJsonNode } from '../model';

but we excepted something like

 // @ts-ignore
 import type { JmsDlqEventMessageJsonNode } from '../model';

for have a working solution in runtime

openapi-generator version

openapi-generator-maven-plugin in version 7.2.0

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

@jmorille jmorille changed the title issues-17461 [BUG] [typescript-axios] withSeparateModelsAndApi [BUG] [typescript-axios] withSeparateModelsAndApi Bad import of interface model - missing import type Dec 22, 2023
@jmorille jmorille closed this by deleting the head repository Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant