Open musjj opened 4 months ago
@musjj , add this one as well. Unable to generate openapi contract json due to updations on how a procedure definition is generated by latest @trpc/server (right now i'm using 11-rc version)
@jlalmes Do you have time to review/merge PRs? If not, can I do it instead?
As a side note, I'm the creator of the SWC project and maintainer of next.js/turbopack, although I'll not use working hours for this.
Also a popup package here: https://github.com/vercjames/package-trpc-swagger
@kdy1 I'm getting the following error when errors are thrown or malformed JSON is posted to one of the endpoints:
TypeError: router._def.getErrorShape is not a function
at ~/whatever/node_modules/.pnpm/better-trpc-openapi@0.1.0_@trpc+server@11.0.0-rc.477_zod@3.23.8/node_modules/better-trpc-openapi/src/adapters/node-http/core.ts:168:38
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ~/whatever/node_modules/.pnpm/better-trpc-openapi@0.1.0_@trpc+server@11.0.0-rc.477_zod@3.23.8/node_modules/better-trpc-openapi/src/adapters/express.ts:18:5
Have you encountered this TypeError
before and if so, what am I doing wrong here?
@kdy1 I'm getting the following error when errors are thrown or malformed JSON is posted to one of the endpoints:
TypeError: router._def.getErrorShape is not a function at ~/whatever/node_modules/.pnpm/better-trpc-openapi@0.1.0_@trpc+server@11.0.0-rc.477_zod@3.23.8/node_modules/better-trpc-openapi/src/adapters/node-http/core.ts:168:38 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async ~/whatever/node_modules/.pnpm/better-trpc-openapi@0.1.0_@trpc+server@11.0.0-rc.477_zod@3.23.8/node_modules/better-trpc-openapi/src/adapters/express.ts:18:5
Have you encountered this
TypeError
before and if so, what am I doing wrong here?
Encountering this same issue right now
@kdy1 are you still interested in this? @jlalmes do you have any thoughts? I've love if we could organize a group of folks to maintain this actively. Maybe we could do a brief huddle with 1-3 folks who are using this project in production and try to get a fork properly maintained.
@tristanz Yes, I don't actively use my fork at the moment, but I'll need to expose my APIs in my private project in a near future.
I have a fork that works with tRPC 11 https://www.npmjs.com/package/trpc-to-openapi
it's been running fine with t3-app/NextJS. However, I don't use other adapters, I fixed all tests cases for everything so in theory they should work. The only thing I couldn't port was the serverless adapter, the trpc implementation changed too much.
This is a fork of another fork (https://github.com/LilyRose2798/trpc-openapi) which uses zod-openapi
instead of zod-to-json-schema
and some other fixes.
PR are welcomed
@kdy1 are you actively maintaining your fork? If not, would you be open to us taking it over? We're going to be using it and committing to it.
@tayhalla Of course. Are you going to maintain it as a team?
Is there any fork that works fine with NextJS app router? I've only found examples with the old pages router, and although the tRPC > OpenAPI conversion works fine, I've been struggling to set up a request handler using app router.
Thanks in advance!
Update: trpc-to-openapi (https://www.npmjs.com/package/trpc-to-openapi) finally worked for me with both tRPC v11 and NextJS 15 👍 . Huge thanks to @mcampa
It looks like a year has passed since the last commit and @jlalmes is now focusing on other things according to the bio in his profile.
Are there any plans to pass down the project to a new maintainer? I'm really thankful for this project, but it's really a shame to see it slowly becoming incompatible with the ecosystem:
For now I'm making do by using:
src/adapters/fetch.ts
into your project)I haven't tested them extensively, but they do work decently on my small projects.