Getting Error : Input parser key: "from" must be ZodString
See original GitHub issueHey thanks for this library,
I am trying to understand why the value of an input objects must be a ZodString. I get following error : Input parser key: "from" must be ZodString
input: z.object({
from: z.number(),
to: z.number(),
}),
I read here https://github.com/jlalmes/trpc-openapi/blob/next/README.md that the input object is defined as ZodObject<{ [string]: ZodString }>
but openApiSpec also allows number/ integer etc
at least number would be good.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
RFC: Support number , boolean , Date in query params #44
That makes sense since query params are strings (so you get an error like Input parser key: "limit" must be ZodString ).
Read more >Zod: create a schema using an existing type - Stack Overflow
I would suggest doing the following: import { z } from 'zod'; import type { Method } from 'axios'; const methods: z. ZodType<Method>...
Read more >Schema validation in TypeScript with Zod - LogRocket Blog
In this article, you will learn about schema design and validation in Zod and how to run it in a TypeScript codebase at...
Read more >Data validation with automatic typing using zod - CodeX Team
So that we don't have to maintain both types and code for validation at the ... After running this code, we will get...
Read more >/README.md | zod@v3-snapshot-2021-01-21 | Deno
Given any Zod schema, you can call its .parse method to check data is valid. ... If there are any unknown keys in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
These days there are plenty of readme and quite a few good modules, which just do what they supposed to do, isn’t it?
Can you please add coerce support?