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) –