Skip to content

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

Description

@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

denoland/deno#8482

Suggest a fix

I will create a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions