Details
-
Bug
-
Resolution: Done
-
Minor
-
None
-
None
-
None
-
None
Description
Add server side validation to avoid persistence exceptions.
eg: Trying to register an installation with long name results to javax.persistence.PersistenceException: org.hibernate.exception.DataException: Value too long for column "DEVICETOKEN VARCHAR(255) SELECTIVITY 100"
This happens for almost all the basic operations like Push App registration, Variant registration and installation registrations.
In addition the WS responses do not contain information about the bad request causes. So in order to order to understand what went wrong, someone has to check the server side logs.
e.g:
if (androidVariant.getGoogleKey() == null) {
return Response.status(Status.BAD_REQUEST).build();
}
It would be a better approach to remove snippets like the above one, to add Bean Validation checks and fill the response entity with a Map of ConstraintViolation property paths (bean root class) and messages.
If you believe that this issue is better described as a feature request, feel free to modify it.