I’ve upgraded a grails project 1.3.9 -> 2.2 and now i get an error regarding the constraints of a callback to an external service having a capitalised first letter. I’ve removed the constraint requirement for this property, but would like to find a way to keep the constraint functionality but i need to have a property with a capital letter. I do not control the external API that is sending a capitalised param back.
The callback closure looks like this:
class CallbackCommand{
String token
String ID
static constraints = {
token nullable: false
//ID nullable: false
}
}
I’ve commented the ID constraint as this fails due to the capitalised first letter.
How can i enforce this constraint but keep the parameter naming consistent with the external API?
Define a customized validator for
IDproperty like this: