Skip to content

Commit 06f0b68

Browse files
authored
fix(typescript): remove incorrect file extensions (#20194)
* fix(typescript): remove incorrect file extensions url, http, and https are Node.js core modules, and form-data should be loaded using a bare specifier. This commit removes the file extensions from these imports. * update samples
1 parent 1eaa75b commit 06f0b68

File tree

6 files changed

+10
-10
lines changed
  • modules/openapi-generator/src/main/resources/typescript/http
  • samples
    • client/others/typescript/encode-decode/build/http
    • openapi3/client/petstore/typescript/builds

6 files changed

+10
-10
lines changed

modules/openapi-generator/src/main/resources/typescript/http/http.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{{#platforms}}
22
{{#node}}
33
// TODO: evaluate if we can easily get rid of this library
4-
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data{{importFileExtension}}";
5-
import { URL, URLSearchParams } from 'url{{importFileExtension}}';
6-
import * as http from 'http{{importFileExtension}}';
7-
import * as https from 'https{{importFileExtension}}';
4+
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data";
5+
import { URL, URLSearchParams } from 'url';
6+
import * as http from 'http';
7+
import * as https from 'https';
88
{{/node}}
99
{{/platforms}}
1010
import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}};
@@ -169,7 +169,7 @@ export class RequestContext {
169169
}
170170
{{#platforms}}
171171
{{#node}}
172-
172+
173173
public setAgent(agent: http.Agent | https.Agent) {
174174
this.agent = agent;
175175
}

samples/client/others/typescript/encode-decode/build/http/http.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/default/http/http.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)