Skip to content

Commit e90fc1e

Browse files
committed
refactor: streamline instance generator and enhance schema type handling
This commit includes: - Removed unnecessary import in the instance generator for cleaner code. - Added handling for binary format in schema type determination, improving type accuracy.
1 parent eb84217 commit e90fc1e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/generator/instanceGenerator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { OpenAPIV3 } from "openapi-types";
2-
31
export function generateInstance(): string {
42
return `import type { AxiosInstance } from 'axios';
53

src/generator/schemaGenerator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ function getTypeFromSchema(
2727

2828
switch (schema.type) {
2929
case "string":
30+
if ("format" in schema && schema.format === "binary") {
31+
return "string | { name?: string; type?: string; uri: string }";
32+
}
3033
return "string";
3134
case "number":
3235
case "integer":

0 commit comments

Comments
 (0)