We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I have an API definition with a parameter like this:
{ name: 'limit', type: 'Query', schema: z.number().positive().default(10), },
In my router, req.query.limit is of type number | undefined. I would expect it to be number due to the default value.
req.query.limit
number | undefined
number
The text was updated successfully, but these errors were encountered:
Oh yes, this one is tricky. Thanks for the report.
In frontend, the type is correct, because it allows effectively you to not pass any value.
But in the backend, you effectively expect the value to be generated, so yes indeed, you expect it to be number.
I'll need to extend @zodios/core to add support for this.
@zodios/core
Sorry, something went wrong.
@epotter2297 This is now fixed in version @zodios/core v10.4.4 and @zodios/express v10.4.3
v10.4.4
@zodios/express
v10.4.3
No branches or pull requests
If I have an API definition with a parameter like this:
In my router,
req.query.limit
is of typenumber | undefined
. I would expect it to benumber
due to the default value.The text was updated successfully, but these errors were encountered: