practicajs / practica

Node.js solution starter boilerplate that is production-ready, packed with ✅ best practices and built with simplicity in mind
https://practica.dev/
MIT License
1.47k stars 136 forks source link

Lacking type coercion during validation #237

Open goldbergyoni opened 2 years ago

goldbergyoni commented 2 years ago

When validating input, it's also the right place to coerce value to their right domain type

For example, when getting req.body.userId - it's string by default, inside our domain it should be a number

Ajv supports this: https://ajv.js.org/coercion.html

Taimoorkhan1122 commented 1 year ago

Hi, I would like to contribute to this amazing repo, is this issue still relevant?