有沒有辦法在JSON轉換器中刪除類字段?Grails - grails.converters.JSON - 刪除類名
例子:
import testproject.*
import grails.converters.*
emp = new Employee()
emp.lastName = "Bar"
emp as JSON
爲字符串是
{"class":"testproject.Employee","id":null,"lastName":"Bar"}
我寧願
{"id":null,"lastName":"Bar"}
有沒有辦法在月底添加一行代碼刪除類字段?
入住這對方的回答http://stackoverflow.com/questions/5538423/grails-jsonbuilder/5540471#5540471 – Maricel