_e.g._ `?input=${JSON.stringify(encodeURIComponent(input))` |\r\n| `POST` | `.mutation()` | Input as post body. | \r\n\r\n## Considerations with OpenAPI\r\n\r\n- Resources are usually `/{resource}/{id}?param1=x¶m2=y`-style - tRPC is [currently] with `{resource}?input=JSON.stringify(encodeURIComponent(input))`-style\r\n- JSON-RPC based response shape might not be the ideal response shape for OpenAPI\r\n- An output schema usually have a `$ref`-schema which would be possible to do automatically / first feature people would request is to make different paths request the same input type\r\n- Actually using zod or any other validation on a resolver's `output` would slow down API outputs.\r\n\r\n## Related\r\n\r\nhttps://github.com/trpc/trpc/discussions/271\r\n",[2923,2926],{"name":2924,"color":2925},"🙋♂️ help wanted","008672",{"name":2927,"color":2928},"💬 discussion","4B318A",755,"[RFC] Using tRPC for public-facing APIs (OpenAPI/Swagger/etc)","2022-06-19T00:48:45Z","https://github.com/trpc/trpc/issues/755",0.6998928,{"description":2935,"labels":2936,"number":2942,"owner":2857,"repository":2858,"state":2876,"title":2943,"updated_at":2944,"url":2945,"score":2946},"I'm looking for a way to add openapi annotations to inputs and outputs.. something like:\r\n```\r\n// Router\r\nexport const appRouter = t.router({\r\n sayHello: t.procedure\r\n .meta({ openapi: { method: 'GET', path: '/say-hello/{name}' } })\r\n .input(z.object({ name: z.string().openapi({ description: \"Your full name\", example: \"Sonny Moore\" }) /* 👈 */, greeting: z.string() }))\r\n .output(z.object({ greeting: z.string() }))\r\n .query(({ input }) => {\r\n return { greeting: `${input.greeting} ${input.name}!` };\r\n });\r\n});\r\n```\r\n\r\nThe [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi) extension enables the openapi annotation, but you have to then manually create each path.\r\n\r\nWhat would great is a mashup of `trpc-openapi` and `zod-to-openapi`.\r\n\r\nI think this would be possible by swapping out the [`zod-to-json-schema`](https://github.com/StefanTerdell/zod-to-json-schema) library with the generator in `zod-to-openapi`.\r\n\r\nIf there's interest in this I might be able to spend some time on it.",[2937,2940],{"name":2938,"color":2939},"enhancement","a2eeef",{"name":2941,"color":2925},"help wanted",261,"RFC: Add `\"examples\"` to OpenAPI schema","2023-05-24T08:54:31Z","https://github.com/trpc/trpc-openapi/issues/261",0.7002308,["Reactive",2948],{},["Set"],["ShallowReactive",2951],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$feHr1Xcpj_sa4VO6AGfZ8rGtF0d8KEE8unYTIogGn9Ww":-1},"/trpc/trpc-openapi/196"]