I have this REST API which performs CRUD operations over Clients.
When I get requests containing invalid fields, for instance, a "name" field with over 100 characters, a http error code is returned along with details: "Name field must be less than 100 characters!"
Problem: I must return multiple errors at a time, for example, if "name" and "birthday" are invalid in the same request, both error details must be shown.
Question 1: Is it a good design for APIs to return more than one error? Or should I rely on View to validate those input errors and keep my API as it is?
In case I end up implementing multiple returns I'll come across another issue: my project implements domain-driven design. It means there is a domain (class) and validation is taken care on constructor. If something goes wrong, exception is thrown!
Question 2: How should I validate all my fields, if my flow is broken on the first exception?
I hope it was clear to understand and thanks in advance!