I have implemented domain class:
package xxx
class Machine {
String name
static constraints = {
}
}
and I also have got a service:
package xxx
import javax.ws.rs.Path
import javax.ws.rs.GET
import javax.ws.rs.Produces
import grails.converters.JSON
import org.json.simple.JSONObject
@Path('/api/machine')
class MachineService {
@GET
@Produces(['application/json'])
def String readAll() {
Machine.findAll() as JSON
}
}
and the output is:
[{"class":"xxx.Machine","id":1,"name":"test1"},{"class":"xxx.Machine","id":2,"name":"test2"},{"class":"xxx.Machine","id":3,"name":"test3"}]
I would like to remove field "class". Could you show me the easiest way to reach this goal ?