-
-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
Is your feature request related to a problem? Please describe.
It would be nice to have the whole context of the issue. Let's take for example the following code in a zod's superRefine
ctx.addIssue({
code: 'custom',
path: ['code'],
minimum: serial_number_min_length,
message: 'min_serial_number',
});
If I take a look to the form state, under code
{
"message": "min_serial_number",
"type": "",
"ref": {}
}
Loosing minimum
key which may be useful for some use cases.
Describe the solution you'd like
Maybe adding a dedicated key for zod issues to the result would be the solution. Resulting in:
{
"message": "min_serial_number",
"type": "",
"ref": {},
"zodIssue": <rawIssue>
}
Describe alternatives you've considered
Currently there is no workaround except for customizing the message directly which may not be the best thing to do for some use cases. (eg. message is used as i18n key) to be translated later on.
Metadata
Metadata
Assignees
Labels
No labels