Protofy icon indicating copy to clipboard operation
Protofy copied to clipboard

In a Zod schena, when I add .optional().hint() to a z.number() it changes the type to string

Open theG3n15 opened this issue 1 year ago • 0 comments

Expected Behavior

I want to have a type number with the modifiers .optional() and .hint()

Current Behavior

I have a zod schema with a z.number().optional().hint() property. When I try to add a new object, it crashes this part, returning an error of "Expected number, recieved string"

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to admin panel
  2. Create an object with a z.number().optional().hint() propery
  3. Try to add a new object by filling that property input

Context (Environment)

  • Default setup
  • OS: Windows 11
  • Browser: Chrome
  • Environment: dev

Issue demo

Captura de pantalla 2024-02-08 152848

Captura de pantalla 2024-02-08 152908

theG3n15 avatar Feb 08 '24 15:02 theG3n15