♻️ Remove modify id script in favor of openapi-ts config (#1434)

This commit is contained in:
Patrick Arminio
2024-11-27 12:42:44 +01:00
committed by GitHub
parent b7d2df2f81
commit 953e9e5416
5 changed files with 133 additions and 157 deletions

View File

@@ -10,6 +10,19 @@ export default defineConfig({
name: "@hey-api/sdk",
// NOTE: this doesn't allow tree-shaking
asClass: true,
operationId: true,
methodNameBuilder: (operation) => {
// @ts-ignore
let name: string = operation.name
// @ts-ignore
let service: string = operation.service
if (service && name.toLowerCase().startsWith(service.toLowerCase())) {
name = name.slice(service.length)
}
return name.charAt(0).toLowerCase() + name.slice(1)
},
},
],
})