From 6a7c22461bdf182ec4969ef91f0ad3b07d110a90 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 23 Jul 2026 18:37:59 +0200 Subject: [PATCH] Update `openapi-ts.config.ts` to apply migration steps --- frontend/openapi-ts.config.ts | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/frontend/openapi-ts.config.ts b/frontend/openapi-ts.config.ts index b5a69e20..3435ef4a 100644 --- a/frontend/openapi-ts.config.ts +++ b/frontend/openapi-ts.config.ts @@ -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", - // 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) + operations: { + // NOTE: this doesn't allow tree-shaking + strategy: "byTags", + methods: "static", + containerName: "{{name}}Service", + methodName: (name: string): string => name.replace(/^[^-]*-/, ""), }, }, - { - name: "@hey-api/schemas", - type: "json", - }, ], })