Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14975
Closed
Open
Issue created Mar 16, 2023 by Waqas Tahir@wakaztahir4 of 6 checklist items completed4/6 checklist items

[BUG] Typescript Fetch Client Code Fails

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 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

There are couple of issues with the generated code on Windows , The typescript code contains errors

1 - ERROR IN export and import , I pasted the whole folder with tsconfig.json , since generated tsconfig.json is being used , there shouldn't be this error
ERROR in src/api/index.ts:5:10
TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    3 | export * from "./models/all";
    4 | export { createConfiguration } from "./configuration"
  > 5 | export { Configuration } from "./configuration"
      |          ^^^^^^^^^^^^^
    6 | export * from "./apis/exception";
    7 | export * from "./servers";
    8 | export { RequiredError } from "./apis/baseapi";

ERROR in src/api/index.ts:10:10
TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
     8 | export { RequiredError } from "./apis/baseapi";
     9 |
  > 10 | export { PromiseMiddleware as Middleware } from './middleware';
       |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    11 | export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI';
    12 |
    13 |
Object Serializer Imports in Body of module
[eslint] 
src\api\models\ObjectSerializer.ts
  Line 25:1:  Import in body of module; reorder to top  import/first
  Line 26:1:  Import in body of module; reorder to top  import/first
  Line 27:1:  Import in body of module; reorder to top  import/first
  Line 28:1:  Import in body of module; reorder to top  import/first
  Line 29:1:  Import in body of module; reorder to top  import/first
  Line 30:1:  Import in body of module; reorder to top  import/first
  Line 31:1:  Import in body of module; reorder to top  import/first
  Line 32:1:  Import in body of module; reorder to top  import/first
2 - Error with Backslashes

I don't know if backslashes inside imports work on other operating systems , but they don't work in windows , the backslash is escaping the character and I'm getting an error in IDE

import { Member } from '..\models\Member';
import { ProjectBugsInner } from '..\models\ProjectBugsInner';
import { User } from '..\models\User';
3- How to download the latest master using npm or easily

as I'm using 6.4.0 , which is the latest stable version , If these issues have been fixed in the latest master , I'd like to use that instead but listing the npm version there's no snapshot version there , How can I easily download the latest version

Also the linode server latest uses the older 5.2.0 version which also doesn't work

openapi-generator version

6.4.0

OpenAPI declaration file content or url

any code generated

Generation Details

language : typescript-fetch

Steps to reproduce

1 - Generate code using typescript-fetch

Assignee
Assign to
Time tracking