Scenario : Quarkus version 2.16.5Final , RestEasy Rest End point which uses Hibernate validation for validation.
Incoming Request POJO
@Valid class Employee{ @NotEmpty String empId; String deptId; }
Upon receiving such a request I copy this over to a model class within my application code. The model class looks like this :
@Valid class EmployeeModel{ @NotEmpty String empId; String deptId; }
Now if I happen to have a bug in my application code due to which I end up not copying the field 'empId' from the request to the model class what I see is that Quarkus is enforcing the validation on the model class and as a result rejecting the request with Status Code 400 Bad Request.
This seems wrong. Shouldn't Hibernate validation in Quarkus applications only be applied on the incoming requests ? And even if they are applied inside application code a rejection arising out of this should not be rejected with 400 Status code, right ?