_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",[3100,3102],{"name":3101,"color":3049},"🙋♂️ help wanted",{"name":3103,"color":3104},"💬 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.7362128,{"description":3111,"labels":3112,"number":3116,"owner":3015,"repository":3016,"state":3068,"title":3117,"updated_at":3118,"url":3119,"score":3120},"If have the following procedure\r\n```\r\nsayHello: t.procedure\r\n .meta({ openapi: { method: 'POST', path: '/say-hello/{id}' } })\r\n .input(z.object({ id: z.number(), greeting: z.string() }))\r\n .output(z.object({ greeting: z.string() }))\r\n .query(({ input }) => {\r\n return { greeting: `${input.greeting} ${input.id}!` };\r\n })\r\n```\r\nand I send the following request\r\n```\r\nPOST http://localhost:3000/say-hello/1\r\nContent-Type: application/json\r\n\r\n{\r\n \"greeting\": \"Test\"\r\n}\r\n```\r\nthen I get\r\n```\r\n{\r\n \"message\": \"Input validation failed\",\r\n \"code\": \"BAD_REQUEST\",\r\n \"issues\": [\r\n {\r\n \"code\": \"invalid_type\",\r\n \"expected\": \"number\",\r\n \"received\": \"string\",\r\n \"path\": [\r\n \"id\"\r\n ],\r\n \"message\": \"Expected number, received string\"\r\n }\r\n ]\r\n}\r\n```\r\nLooks like having a request body somehow messes with coercion of the path parameter. Using `z.coerce.number()` instead of `z.number()` for `id` works for now. It should work without the explicit `coerce` according to the [PR](https://github.com/jlalmes/trpc-openapi/pull/219) that added this feature.",[3113],{"name":3114,"color":3115},"bug","ff3333",243,"Path parameters require explicit `coerce` on POST/PATCH/PUT","2023-01-26T12:43:56Z","https://github.com/trpc/trpc-openapi/issues/243",0.73708075,["Reactive",3122],{},["Set"],["ShallowReactive",3125],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fIdiwyslVf6G228MHHkKR__YWjOngyjJvtsB0DlWzNeY":-1},"/trpc/trpc-openapi/324"]