Skip to content

Commit 8af6f50

Browse files
authored
Merge branch 'master' into main
2 parents 36c145a + 414864d commit 8af6f50

File tree

15 files changed

+1721
-611
lines changed

15 files changed

+1721
-611
lines changed

frontend/modify-openapi-operationids.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

frontend/openapi-ts.config.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineConfig } from "@hey-api/openapi-ts"
2+
3+
export default defineConfig({
4+
client: "legacy/axios",
5+
input: "./openapi.json",
6+
output: "./src/client",
7+
// exportSchemas: true,
8+
plugins: [
9+
{
10+
name: "@hey-api/sdk",
11+
// NOTE: this doesn't allow tree-shaking
12+
asClass: true,
13+
operationId: true,
14+
methodNameBuilder: (operation) => {
15+
// @ts-ignore
16+
let name: string = operation.name
17+
// @ts-ignore
18+
let service: string = operation.service
19+
20+
if (service && name.toLowerCase().startsWith(service.toLowerCase())) {
21+
name = name.slice(service.length)
22+
}
23+
24+
return name.charAt(0).toLowerCase() + name.slice(1)
25+
},
26+
},
27+
],
28+
})

0 commit comments

Comments
 (0)