Skip to content

Commit a1bc9de

Browse files
authored
Merge pull request #4 from moznion/do_not_remove_extension
Do not remove the `.d.ts` extension from the `schema` imported in generated client
2 parents 831f491 + 3e72ab1 commit a1bc9de

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function generateClientCode(
7676
"// DO NOT EDIT THIS FILE MANUALLY.",
7777
"// See Also: https://github.com/moznion/openapi-fetch-gen",
7878
`import createClient, { type ClientOptions } from "openapi-fetch";`,
79-
`import type { paths } from "./${schemaFileName.replace(/\.d\.ts$/, "")}"; // generated by openapi-typescript`,
79+
`import type { paths } from "./${schemaFileName}"; // generated by openapi-typescript`,
8080
"",
8181
defaultHeaderType,
8282
clientClass,

src/test_resources/expected_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// DO NOT EDIT THIS FILE MANUALLY.
33
// See Also: https://github.com/moznion/openapi-fetch-gen
44
import createClient, { type ClientOptions } from "openapi-fetch";
5-
import type { paths } from "./schema"; // generated by openapi-typescript
5+
import type { paths } from "./schema.d.ts"; // generated by openapi-typescript
66

77
export class Client {
88
private readonly client;

src/test_resources/expected_client_with_default_headers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// DO NOT EDIT THIS FILE MANUALLY.
33
// See Also: https://github.com/moznion/openapi-fetch-gen
44
import createClient, { type ClientOptions } from "openapi-fetch";
5-
import type { paths } from "./schema"; // generated by openapi-typescript
5+
import type { paths } from "./schema.d.ts"; // generated by openapi-typescript
66

77
type DefaultHeaders = Record<"Authorization" | "Application-Version", string>;
88

0 commit comments

Comments
 (0)