I have the same problem with the REST API : when submitting an observation having a text of about 1600 characters the error appear.
I searched the error message in the github code repository and found a class named ObsValidator having a declaration like this :
public final static int VALUE_TEXT_MAX_LENGTH = 1000; and on line 204 the length of the observation text is compared to this VALUE_TEXT_MAX_LENGTH…
This does not seems to make sense compared to the database field which allows 65536 characters in my setup (i did not changed the field) It would probably be better to check at the database level or to have the same limit…
IMHO the length should be specified at Hibernate mapping level. However we can keep the custom validator provided it reads the length from Hibernate. Another option is to remove the custom validation and leave it to Hibernate.
The best solution would specify the length of the attribute in one place (presumably in Hibernate) and still allow for validation before persisting the data. Given our separation between DAO and service layers, it may be hard to come up with a clean solution (e.g., an interface through which the service layer could retrieve the attribute length).
If forced to compromise, I would think a “correct” (matching) duplicate length in the validator would be preferable to no check in the validator, since (1) the length of this attribute is not changing and (2) clients don’t get a potentially cryptic or poorly timed error storing something that passed validation.
There is already a validateFieldLengths method in ValidateUtil that reads maximum length from Hibernate.
Many validators use it, including ObsValidator but valueText property is not included. The custom validation should be removed and the field added to validateFieldLengths.