Guys I'm trying to use arrow to do validations. I have 14 parameters that i need to validate in order to create an instance of a data class, but zipOrAccumulate only takes up to 9. The requirement is that it validates them all and lists all the errors. What's the correct approach?
j
Johann Pardanaud
06/05/2024, 4:10 PM
I know you might want to stick to Arrow. But if you have a complex use case, you might consider Akkurate, a validation library I'm maintaining. ๐
With it, you can easily accumulate the errors, and it has an integration with Arrow's typed errors.
Feel free to have a look!
14 parameters?
Maybe split these validation across your layers and/or services?
๐ 1
v
vers85
06/05/2024, 7:58 PM
14 parameters coz its just one domain object that i build from the excel workbook. Each sheet contains data for one object and from the domain perspective it's either all properly parsed and returns a list of objects or it's malformed and user needs to know which sheet contains what problems. Doesnt make sense to me to validate it multiple times ๐