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
+7 -19
View File
@@ -5,29 +5,17 @@ export default defineConfig({
output: "./src/client",
plugins: [
"legacy/axios",
{ name: "@hey-api/client-axios", throwOnError: true },
{ name: "@hey-api/typescript", case: "preserve" },
{
name: "@hey-api/sdk",
operations: {
// NOTE: this doesn't allow tree-shaking
asClass: true,
operationId: true,
classNameBuilder: "{{name}}Service",
methodNameBuilder: (operation) => {
// @ts-expect-error
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)
strategy: "byTags",
methods: "static",
containerName: "{{name}}Service",
methodName: (name: string): string => name.replace(/^[^-]*-/, ""),
},
},
{
name: "@hey-api/schemas",
type: "json",
},
],
})