0
我們需要提供在以下形式的調用的響應:彈簧安置文檔嵌套對象
{
"3" : {
"id" : "3",
"parent" : "1",
"title" : "Folder 2",
"folder" : true
},
"4" : {
"id" : "4",
"parent" : "2",
"title" : "Folder 1.1",
"folder" : true
},
"doc:3" : {
"parent" : "3",
"title" : "Document 3",
"folder" : false
},
"doc:2" : {
"parent" : "2",
"title" : "Document 2",
"folder" : false
},
"doc:1" : {
"parent" : "3",
"title" : "Document 1",
"folder" : false
}
}
應該怎麼記錄呢?問題是該對象是一個EntryId作爲鍵的結構,並且在其文檔中不包含id。有沒有我可以使用變量來定義鍵的選項?或什麼推薦使用responseFields?
[如何將對象的響應字段記錄爲Map(HashMap)]的可能重複(http://stackoverflow.com/questions/37432282/how-to-document-response-fields-for-an-object- AS-maphashmap) –