mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
Update openapi-ts.config.ts to apply migration steps
This commit is contained in:
@@ -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",
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user