Skip to content

Commit 4a59378

Browse files
committed
clean
1 parent 94a254f commit 4a59378

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

packages/openapi-typescript/src/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,6 @@ async function openapiTS(schema: string | URL | OpenAPI3 | Readable, options: Op
125125
}
126126
}
127127

128-
// for (const k of Object.keys(rootTypes)) {
129-
130-
// if (rootTypes[k] && !EMPTY_OBJECT_RE.test(rootTypes[k])) {
131-
// output.push(options.exportType ? `export type ${k} = ${rootTypes[k]};` : `export interface ${k} ${rootTypes[k]}`, "");
132-
// } else {
133-
// output.push(`export type ${k} = Record<string, never>;`, "");
134-
// }
135-
136-
// if (options.rootTypes) {
137-
// if (k === "components") {
138-
// console.log(typeof rootTypes[k]);
139-
// // for (const element of rootTypes[k]) {
140-
// // console.log("🚀 ~ file: index.ts:119 ~ element:", element);
141-
// // }
142-
// }
143-
// }
144-
145-
// delete rootTypes[k];
146-
// delete allSchemas["."]; // garbage collect, but also remove from next step (external)
147-
// }
148-
149128
// 2d. external schemas (subschemas)
150129
const externalKeys = Object.keys(allSchemas); // root schema (".") should already be removed
151130
if (externalKeys.length) {

packages/openapi-typescript/src/transform/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { GlobalContext, OpenAPI3 } from "../types.js";
22
import transformComponentsObject from "./components-object.js";
33
import transformPathsObject from "./paths-object.js";
4-
import transformSchemaObjectMap from "./schema-object-map.js";
54
import transformWebhooksObject from "./webhooks-object.js";
65

76
/** transform top-level schema */
@@ -22,15 +21,5 @@ export function transformSchema(schema: OpenAPI3, ctx: GlobalContext): Record<st
2221
if (schema.components) output.components = transformComponentsObject(schema.components, ctx);
2322
else output.components = "";
2423

25-
// $defs
26-
if (schema.$defs) output.$defs = transformSchemaObjectMap(schema.$defs, { path: "$defs/", ctx });
27-
else output.$defs = "";
28-
29-
// types
30-
if (schema.components) output.types = transformComponentsObject(schema.components, ctx);
31-
else output.types = "";
32-
33-
// console.log(output.types);
34-
3524
return output;
3625
}

0 commit comments

Comments
 (0)