Add an option to output Zod schema with generated payload-types #4259
hades200082
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
This would be super useful for using payload in conjunction with trpc procedure input parameters. Api parameters and database rows are often pretty tightly coupled. publicProcedure
.input(PostCollectionSchema.pick({ title: true, body:true }))
.mutation(async ({ ctx, input }) => {
// input.title
// input.body
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When generating payload-types.ts it would be nice if we could have the option to also output the associated Zod schemas as well.
I've tried using ts-to-zod and @runtyping/zod to generate zod schemas but keep running into invalid union errors. :(
Beta Was this translation helpful? Give feedback.
All reactions