Is there a way to remove the class field in a JSON converter?
Example:
import testproject.*
import grails.converters.*
emp = new Employee()
emp
One alternative is to not use the builder:
def myAction = {
def emp = new Employee()
emp.lastName = 'Bar'
render(contentType: 'text/json') {
id = emp.id
lastName = emp.lastName
}
}
This is a bit less orthogonal since you'd need to change your rendering if Employee changes; on the other hand, you have more control over what gets rendered.