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
Hi, Prisma only has simple validation for database fields, but Yup/Joi etc allow have richer validators such as email/regex etc. How much work would it be to put the desired validator+args in decorator comments and apply them in the generator to the ones already picked up?
Suggested solution
Example could be:
/// @PrismaYupGen email.nullable
// or
/// @PrismaYupGen min(1).max(10)
To keep it simple I removed () from validator without args.
Hope to inspire :)
The text was updated successfully, but these errors were encountered:
Awesome! By the way, maybe the namespace could be @PrismaValGen to keep it generic, but only if it is possible to express the validators generically of course. It might be a headache to map them to the respective adapters
Problem
Hi, Prisma only has simple validation for database fields, but Yup/Joi etc allow have richer validators such as email/regex etc. How much work would it be to put the desired validator+args in decorator comments and apply them in the generator to the ones already picked up?
Suggested solution
Example could be:
To keep it simple I removed
()
from validator without args.Hope to inspire :)
The text was updated successfully, but these errors were encountered: