-
Notifications
You must be signed in to change notification settings - Fork 25
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
FieldType detected as string, but it should be a number #265
Comments
Hi @sharenz , have you tried |
@sharenz I'm gonna close the issue but feel free to re-open it if it doesn't work |
@gustavoguichard, I'm reopening this one because we should strive to support all possible ways of construing Zod schemas. Zod's API has grown a lot since the early days of Remix Forms, and now we need to catch up 😅 The only reason to close this one would be if we could not find a solution and gave up. |
@sharenz, you are creating the schemas dynamically, right? |
@danielweinmann Yes they are generated automatically. In detail, I have a python backend using fastapi, which automatically generates the openapi spec. Then I am using "orval" to create the zod schema for my remix app. I checked briefly and I am using the correct way in both projects to setup the schema. So I am not aware of a workaround which would allow me to change the generated schema. |
Awesome, thanks! I don't think we'll be able to fix this before v3, but we plan to release v3 with a solution for this use case. |
I am creating my zod schema using orval from my openapi spec.
So the resulting schema looks like:
The FieldType is string in this case, so I always get the error "Number expected, received string".
When I change the schema it is working fine. Unfortunately this is not a good solution for me, as I want to generate the forms directly from the api definition.
Can I overwrite the type somehow or is there a chance this can be fixed?
The text was updated successfully, but these errors were encountered: