grails-json-rest-api
grails-json-rest-api copied to clipboard
Extra "properties" attribute in JSON response
Hi, I just installed the plugin and found something weird in the JSON response for a given entity:
{"success":true,"data":{"aggregates":null,"attached":true,"categories":[],"errors":{"errors":[]},"id":1,"longDescription":"asef","modifiers":null,"name":"ert","properties":{"longDescription":"asef","aggregates":null,"typeId":null,"type":null,"modifiers":null,"categories":[],"aggregatesId":null,"modifiersId":null,"name":"ert","shortDescription":"ert"},"shortDescription":"ert","type":null}}
As you can see, there is a "properties" attribute that contains a duplicate of all the properties of the domain object.
That is a Grails artifact which is included as part of the default JSON rendering. Use the 'excludedFields' parameter to exclude this. See http://www.grails.org/plugin/json-rest-api .