1

Hi I'm pretty new to both FlexJson and emberjs.

According to the ember guides, ember requires json in the following format:

{
  "post": {
      "comments": [1, 2, 3]
  }
}

I'm using the following for a particular model:

public static JSONSerializer licence = new JSONSerializer()
    .exclude("class")
    .exclude("persistent")
    .exclude("entityId")
    .rootName("licence")
    .include("licenceFeatures.id")
    .exclude("licenceFeatures.*");

And I'm getting the following output:

{
    "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"
    }
}

How do I format the "licenceFeatures" array in the form ember expects?

mjpwall
  • 106
  • 1
  • 7

0 Answers0