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",
|
output: "./src/client",
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
"legacy/axios",
|
{ name: "@hey-api/client-axios", throwOnError: true },
|
||||||
|
{ name: "@hey-api/typescript", case: "preserve" },
|
||||||
{
|
{
|
||||||
name: "@hey-api/sdk",
|
name: "@hey-api/sdk",
|
||||||
// NOTE: this doesn't allow tree-shaking
|
operations: {
|
||||||
asClass: true,
|
// NOTE: this doesn't allow tree-shaking
|
||||||
operationId: true,
|
strategy: "byTags",
|
||||||
classNameBuilder: "{{name}}Service",
|
methods: "static",
|
||||||
methodNameBuilder: (operation) => {
|
containerName: "{{name}}Service",
|
||||||
// @ts-expect-error
|
methodName: (name: string): string => name.replace(/^[^-]*-/, ""),
|
||||||
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)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "@hey-api/schemas",
|
|
||||||
type: "json",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user