When using parseRequest:true in UrlMappings the GSON.parse() method is parsing the id as a Double, causing problems when you create the instance from the params map and your domain class can have the id bindable (I need this for legacy databases).
class MyDomainClass {
String descr
static constraints = {
id bindable: true, generator: 'assigned'
}
}
JSON POST
{"id":77,"desc":"Test"}
MyDomainClass domain = new MyDomainClass(params) //java.lang.NumberFormatException
It would be nice to convert the id to the Long, or his declared type, instead of using Google's default.
I also tried creating the instance from request.GSON, but it returns null (still don't figured out why).
When using parseRequest:true in UrlMappings the GSON.parse() method is parsing the id as a Double, causing problems when you create the instance from the params map and your domain class can have the id bindable (I need this for legacy databases).
It would be nice to convert the id to the Long, or his declared type, instead of using Google's default.
I also tried creating the instance from request.GSON, but it returns null (still don't figured out why).