Json 使用HTTPBuilder和Grails在REST调用后出现奇怪的“新”属性

Json 使用HTTPBuilder和Grails在REST调用后出现奇怪的“新”属性,json,spring,rest,grails,httpbuilder,Json,Spring,Rest,Grails,Httpbuilder,我有一个grails控制器使用HTTPBuilder对Spring后端进行REST调用: def getSettings(String customerID) { def http = new HTTPBuilder( grailsApplication.config.com.company.product.productWebserviceURL ) def result = [:] def postBody = [customerID: customerID]

我有一个grails控制器使用HTTPBuilder对Spring后端进行REST调用:

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
}
一切都很好,除了在获得JSON响应时,有一个名为new的新属性。下面是将作为JSON从我的Spring后端返回的设置对象:

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
}
这里是grails控制器中的JSON响应。请注意,额外的第五个属性不是原始设置对象的一部分:


有人知道这个叫做“新”的神秘财产是如何不断增加的吗

运行到spring数据jpa文档后

我看到spring数据将根据id列是否为null添加一个新属性。以下内容直接取自文件:


Id属性检查默认情况下Spring数据JPA检查给定实体的Id属性。如果Id属性为null,则实体将被假定为新的,否则将被假定为非新的。

如果您说的是新属性,那么从何时开始?最近有什么变化吗?你可以指出这一点,或者刚刚注意到了吗?事实上,我刚刚注意到了。所谓新,我的意思是物业的名称是新的。第二张图片上有。我不知道这是什么时候开始发生的,但我注意到,当从spring传回时,我们的每一个域对象都会发生这种情况?这是什么课?