_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",[3073,3076],{"name":3074,"color":3075},"🙋♂️ help wanted","008672",{"name":3077,"color":3078},"💬 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.64791197,{"description":3085,"labels":3086,"number":3092,"owner":3019,"repository":3020,"state":3057,"title":3093,"updated_at":3094,"url":3095,"score":3096},"## 🚘 v1.0.0 Roadmap\r\n\r\n### 🏠 House keeping\r\n\r\n- [x] Write `v0` -> `v1` migration guide. (currently maintained here https://github.com/jlalmes/trpc-openapi/pull/143)\r\n\r\n### 🚀 Definite\r\n\r\n- [x] Support tRPC `v10`. (https://github.com/jlalmes/trpc-openapi/issues/73)\r\n- [x] Remove response wrapper (https://github.com/jlalmes/trpc-openapi/pull/144)\r\n- [x] Add CORS setup to examples. (https://github.com/jlalmes/trpc-openapi/pull/122)\r\n- [x] Deprecate `meta.tag` (use `meta.tags` instead). (https://github.com/jlalmes/trpc-openapi/pull/92)\r\n- [x] Default to `enabled: true` when `meta.openapi` is defined. (https://github.com/jlalmes/trpc-openapi/issues/68)\r\n- [x] Fix YAML file `$refs`. (https://github.com/jlalmes/trpc-openapi/issues/37)\r\n- [x] Allow `method: 'DELETE'` in `mutation` procedures. (https://github.com/jlalmes/trpc-openapi/pull/123)\r\n- [x] Add `meta.headers`. (https://github.com/jlalmes/trpc-openapi/issues/113)\r\n- [x] Support `z.refine()`. (https://github.com/jlalmes/trpc-openapi/pull/102)\r\n- [x] Performance improvements. (https://github.com/jlalmes/trpc-openapi/pull/125)\r\n- [x] #156\r\n\r\n### 🤔 Maybe\r\n- [ ] Support `z.number()` query input. (https://github.com/jlalmes/trpc-openapi/issues/44)\r\n- [ ] Support `z.boolean()` query input. (https://github.com/jlalmes/trpc-openapi/issues/44)\r\n- [ ] Support `z.date()` query input. (https://github.com/jlalmes/trpc-openapi/issues/44)\r\n- [ ] Support `z.array()` query inputs. (https://github.com/modtree/modtree/pull/358#discussion_r929558840)\r\n- [ ] Add model schemas to OpenAPI document. (https://github.com/jlalmes/trpc-openapi/issues/157)\r\n- [ ] Add `Fastify` adapter. (https://github.com/jlalmes/trpc-openapi/issues/87)\r\n- [x] Add `Lambda` adapter. (https://github.com/jlalmes/trpc-openapi/issues/115)\r\n- [ ] Add `meta.examples`.\r\n- [ ] Add `override` object to `OpenApiMeta` and `GenerateOpenApiDocumentOptions`.\r\n\r\n### 🏋️♀️ Stretch\r\n- [ ] Support non-`z.object()` input.\r\n - Input is mandated as `z.object()` if using `pathParameters`.\r\n - Query input should be `?input=`.\r\n- [ ] Remove `output` schema requirement. (https://github.com/jlalmes/trpc-openapi/issues/61#issuecomment-1180611408)\r\n- [ ] Remove `zod` validator requirement.",[3087,3089],{"name":3088,"color":3075},"help wanted",{"name":3090,"color":3091},"roadmap","D33017",91,"🚘 v1.0.0 Roadmap","2022-11-27T13:56:32Z","https://github.com/trpc/trpc-openapi/issues/91",0.6562974,{"description":3098,"labels":3099,"number":3106,"owner":3019,"repository":3019,"state":3057,"title":3107,"updated_at":3108,"url":3109,"score":3110},"### Describe the feature you'd like to request\r\n\r\nAdd a simpler alternative way to define procedures.\r\n\r\n\r\nThis is the current way of doing it:\r\n\r\n```ts\r\nimport { publicProcedure, router } from './trpc';\r\nimport { z } from 'zod';\r\n \r\nexport const appRouter = router({\r\n hello: publicProcedure\r\n .input(\r\n z\r\n .object({\r\n text: z.string(),\r\n })\r\n .optional(),\r\n )\r\n .query(({ input }) => {\r\n return {\r\n greeting: `hello ${input?.text ?? 'world'}`,\r\n };\r\n }),\r\n});\r\n\r\n```\r\n\r\n### Describe the solution you'd like to see\r\n\r\nMost of the time, I use some sort of base procedure that does all the authz/authn, and end up just doing `.input(x).query(() => { /*...*/} )` etc at the end.\r\n\r\nHere I'm proposing to **adding** an alternative way of defining procedures that I think is a bit more readable:\r\n\r\n```ts\r\nimport { publicProcedure, router } from './trpc';\r\nimport { z } from 'zod';\r\n\r\nexport const appRouter = router({\r\n hello: publicProcedure.query({\r\n input: z\r\n .object({\r\n text: z.string(),\r\n })\r\n .optional(),\r\n resolve({ input }) {\r\n return {\r\n greeting: `hello ${input?.text ?? 'world'}`,\r\n };\r\n },\r\n }),\r\n});\r\n```\r\n\r\n### Desribe alternate solutions\r\n\r\n- There's maybe some alternative way of addressing this\r\n- This is very much a nice-to-have. \r\n- Maybe it can be a bit misleading to have two ways of doing things\r\n\r\n### Additional information\r\n\r\n- Related: #2940\r\n- `input` should not be required\r\n- Needs to work when the base procedures have existing input parsers\r\n- If someone wants to pick this up, I'll happily provide a test suite to work against\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [X] 🙋♂️ Yes, I'd be down to file a PR implementing this feature!",[3100,3103],{"name":3101,"color":3102},"@trpc/server","9BE78E",{"name":3104,"color":3105},"RFC","78B062",2975,"feat: Add alternative way to create procedures","2022-10-13T13:29:56Z","https://github.com/trpc/trpc/issues/2975",0.6584798,{"description":3112,"labels":3113,"number":3117,"owner":3019,"repository":3020,"state":3057,"title":3118,"updated_at":3119,"url":3120,"score":3121},"I'm trying to use https://github.com/koxudaxi/datamodel-code-generator to generate python types but the openapi.json file generated by this library doesn't output OpenAPI models that are used in each request (every request just has the inline schema defined) which is required by this other lib.\r\n\r\nWould be awesome to split things out into proper models so we can have a TRPC \u003C> openAPI \u003C> python types/ client bridge :).\r\n\r\nThanks for making this library!",[3114],{"name":3115,"color":3116},"duplicate","cfd3d7",274,"Split openapi definition into components + requests for easier type generation to python","2023-05-24T07:51:44Z","https://github.com/trpc/trpc-openapi/issues/274",0.66227573,["Reactive",3123],{},["Set"],["ShallowReactive",3126],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fjJ20IjGKIFwcnuyGB7h7t0Qrbtmwfl3Z22F4F3U8EqY":-1},"/trpc/trpc-openapi/261"]