Skip to content

Commit dcba0d5

Browse files
committed
wip
1 parent a2f6a9e commit dcba0d5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/openapi-typescript/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"dependencies": {
5757
"ansi-colors": "^4.1.3",
58+
"camelcase": "^7.0.1",
5859
"fast-glob": "^3.3.0",
5960
"js-yaml": "^4.1.0",
6061
"supports-color": "^9.4.0",

packages/openapi-typescript/src/transform/components-types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import camelCase from "camelcase";
12
import type { ComponentsObject, GlobalContext } from "../types.js";
23
import { escObjKey, getEntries, getSchemaObjectComment, indent, tsReadonly } from "../utils.js";
34
import transformSchemaObject from "./schema-object.js";
@@ -18,7 +19,7 @@ export default function transformComponentsObjectToTypes(components: ComponentsO
1819
ctx: { ...ctx, indentLv: indentLv },
1920
});
2021

21-
output.push(indent(`export type ${key} = ${schemaType};\n`, indentLv));
22+
output.push(indent(`export type ${camelCase(key, { pascalCase: true })} = ${schemaType};\n`, indentLv));
2223
}
2324
} else {
2425
output.push(indent("schemas: never;", indentLv));

0 commit comments

Comments
 (0)