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
  • #8264
Closed
Open
Issue created Dec 24, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][typescript(experimental)] Support Deno v1.6

Created by: chibat

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

The Generated Deno code does not work with Deno v1.6 .

openapi-generator version

v5.0.0

OpenAPI declaration file content or url

https://petstore.swagger.io/v2/swagger.json

Steps to reproduce
$ java -jar openapi-generator-cli-5.0.0.jar generate -i https://petstore.swagger.io/v2/swagger.json -g typescript --additional-properties=platform=deno -o generated-src

$ echo '
import * as petstore from "./generated-src/index.ts";

const configuration = petstore.createConfiguration();
const petApi = new petstore.PetApi(configuration);
const pets = await petApi.findPetsByStatus(["available"]);
console.log(pets.slice(0, 5));
' > test.ts

$ deno --version
deno 1.6.2 (release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.1.3

$ deno run --allow-net=petstore.swagger.io test.ts
Check file:///home/gitpod/work/test.ts
error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { createConfiguration, Configuration } from "./configuration.ts"
                              ~~~~~~~~~~~~~
    at file:///home/gitpod/work/generated-src/index.ts:4:31

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { PromiseMiddleware as Middleware } from './middleware.ts';
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///home/gitpod/work/generated-src/index.ts:8:10

Found 2 errors.
Generation Details

actual

export { createConfiguration, Configuration } from "./configuration.ts"
export { PromiseMiddleware as Middleware } from './middleware.ts';

expect

export { createConfiguration } from "./configuration.ts"
export type { Configuration } from "./configuration.ts"
export type { PromiseMiddleware as Middleware } from './middleware.ts';
Related issues/PRs

https://github.com/denoland/deno/pull/8482

Suggest a fix

I will create a PR.

Assignee
Assign to
Time tracking