Closed danilofuchs closed 2 weeks ago
We really like using class services in our tRPC router, as it avoids the need for passing client to every request
client
As it is server side, we don't care about code splitting
When using both @hey-api/client-fetch and asClass: true, the output is broken:
@hey-api/client-fetch
asClass: true
BaseHttpRequest
Service.ts
https://github.com/danilofuchs/openapi-ts-repro
import { defineConfig } from "@hey-api/openapi-ts"; export default defineConfig({ input: "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/refs/heads/main/examples/v3.0/api-with-examples.yaml", output: { path: "src/server", }, client: "@hey-api/client-fetch", name: "Service", services: { asClass: true, }, });
No response
@danilofuchs Remove the ‘name` option, that's what's causing the trouble
我也遇到了同样的问题,他 service.name 取的是 operation.description 的值
Description
We really like using class services in our tRPC router, as it avoids the need for passing
client
to every requestAs it is server side, we don't care about code splitting
When using both
@hey-api/client-fetch
andasClass: true
, the output is broken:BaseHttpRequest
in services.gen.tsService.ts
Reproducible example or configuration
https://github.com/danilofuchs/openapi-ts-repro
OpenAPI specification (optional)
No response
System information (optional)
No response