I have a grails controller making a REST call using HTTPBuilder to a Spring backend:
def getSettings(String customerID) {
def http = new HTTPBuilder( grailsApplication.config.com.company.product.productWebserviceURL )
def result = [:]
def postBody = [customerID: customerID]
try {
http.post(path: 'product/getSettings', body: postBody, requestContentType: URLENC) { resp, json ->
result = json
}
} catch (IOException ex) {
logger.error("Cannot in attempting to get settings via webservice for customerID: " + customerID + ". Is the server running? \nError: " + ex.getMessage())
result['errors'] = [[message : this.CUSTOMER_FACING_TRANSACTIONHISTORY_DOWN_MESSAGE]]
response.status = 500;
}
render result as JSON
}
Everything is fine, except when getting the JSON response, there is this new property called "new." Here is the Settings object about to be returned as JSON from my Spring backend:
And here it is as the JSON response in the grails controller. Notice the extra fifth property that is not part of the original Settings object.:
Does anyone have an idea how this mysterious property called "new" keeps getting added on?