Update openapi-ts.config.ts to apply migration steps

This commit is contained in:
Yurii Motov
2026-07-23 18:37:59 +02:00
parent 2375da34f2
commit 6a7c22461b
+8 -20
View File
@@ -5,29 +5,17 @@ export default defineConfig({
output: "./src/client", output: "./src/client",
plugins: [ plugins: [
"legacy/axios", { name: "@hey-api/client-axios", throwOnError: true },
{ name: "@hey-api/typescript", case: "preserve" },
{ {
name: "@hey-api/sdk", name: "@hey-api/sdk",
// NOTE: this doesn't allow tree-shaking operations: {
asClass: true, // NOTE: this doesn't allow tree-shaking
operationId: true, strategy: "byTags",
classNameBuilder: "{{name}}Service", methods: "static",
methodNameBuilder: (operation) => { containerName: "{{name}}Service",
// @ts-expect-error methodName: (name: string): string => name.replace(/^[^-]*-/, ""),
let name: string = operation.name
// @ts-expect-error
const service: string = operation.service
if (service && name.toLowerCase().startsWith(service.toLowerCase())) {
name = name.slice(service.length)
}
return name.charAt(0).toLowerCase() + name.slice(1)
}, },
}, },
{
name: "@hey-api/schemas",
type: "json",
},
], ],
}) })