You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why do you define "path" for errors of isValidDecimalInput. I think it doesn't make sense because it affects the default behaviour. As a result, the error messages for these properties are not accessible in the same way as the messages for the other properties
export const MyModelSchema = z.object({
id: z.number(),
decimal: z
.union([z.number(), z.string(), DecimalJSLikeSchema])
.refine((v) => isValidDecimalInput(v), {
message: 'Field "decimal" must be a Decimal', path: ['Models', 'DecimalModel'],
}),
});
The text was updated successfully, but these errors were encountered:
why do you define "path" for errors of isValidDecimalInput. I think it doesn't make sense because it affects the default behaviour. As a result, the error messages for these properties are not accessible in the same way as the messages for the other properties
export const MyModelSchema = z.object({
id: z.number(),
decimal: z
.union([z.number(), z.string(), DecimalJSLikeSchema])
.refine((v) => isValidDecimalInput(v), {
message: 'Field "decimal" must be a Decimal',
path: ['Models', 'DecimalModel'],
}),
});
The text was updated successfully, but these errors were encountered: