Skip to content
New issue

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

_times reserved parameter can be non numeric #15

Open
dcroote opened this issue Jul 11, 2022 · 1 comment
Open

_times reserved parameter can be non numeric #15

dcroote opened this issue Jul 11, 2022 · 1 comment

Comments

@dcroote
Copy link
Contributor

dcroote commented Jul 11, 2022

To verify, the value below can be changed to a non-number and the tests still pass

"name": "_times",
"default": "1000000"

Validating this is slightly complicated by multiple reserved parameters e.g. _times: ',10000,', but it still should be attainable after splitting using transform and something like:

export const stringifiedNumberSchema = z.string().transform((val) => parseFloat(val));
@Siegrift
Copy link
Contributor

Yeah, none of the reserved parameter values is actually validated as we only verify that the value is a string type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants