Ember.js 如何为emberjs格式化FlexJSON

Ember.js 如何为emberjs格式化FlexJSON,ember.js,flexjson,Ember.js,Flexjson,嗨,我对FlexJson和emberjs都很陌生 根据ember指南,ember需要以下格式的json: { "post": { "comments": [1, 2, 3] } } 我将以下内容用于特定型号: public static JSONSerializer licence = new JSONSerializer() .exclude("class") .exclude("persistent") .exclude("entityId")

嗨,我对FlexJson和emberjs都很陌生

根据ember指南,ember需要以下格式的json:

{
  "post": {
      "comments": [1, 2, 3]
  }
}
我将以下内容用于特定型号:

public static JSONSerializer licence = new JSONSerializer()
    .exclude("class")
    .exclude("persistent")
    .exclude("entityId")
    .rootName("licence")
    .include("licenceFeatures.id")
    .exclude("licenceFeatures.*");
我得到以下输出:

{
    "licence": {
        "id": 1,
        "licenceDescription": "GPL is the most widely used free software license and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same license.",
        "licenceFeatures": [
            {
                "id": 15
            },
            {
                "id": 3
            }
        ],
        "licenceName": "GNU General Public License (GPL) 2.0",
        "licenceURL": "http://opensource.org/licenses/GPL-2.0"
    }
}

如何按照ember期望的格式格式化“licenceFeatures”数组?

ember不需要该格式的数据,ember数据需要。您使用的是余烬数据吗?是的,我使用的是余烬数据,flexjson有没有实现这一点的方法?