-4
[
  {
    "id": "1234",
    "price": 1000,
    "categories": [
      "Fashion/Shirt"
    ],
    "category_id": [
      "1234564"
    ],
    "gender": "Male",
    "brand": "Wonder",
    "fashion_composition": [
      {
        "material": "silk",
        "percentage": 78
      },
      {
        "material": "Cotton",
        "percentage": 22
      }
    ],
    "fashion_season": {
      "season": "continuity",
      "year_season": 2014
    },
    "fashion_size": {
      "size_type": "US",
      "size_description_1": "size",
      "size_1_manufacturer": "90",
      "size_description_2": "top",
      "size_2_manufacturer": "C",
      "size_1": [
        "90"
      ],
      "size_2": [
        "C"
      ]
    }
  },
  {
    "id": "5678",
    "price": 1000,
    "categories": [
      "Fashion/Skirt"
    ],
    "category_id": [
      "1234564"
    ],
    "gender": "Female",
    "brand": "Wonder",
    "fashion_composition": [
      {
        "material": "silk",
        "percentage": 78
      },
      {
        "material": "Cotton",
        "percentage": 22
      }
    ],
    "fashion_season": {
      "season": "continuity",
      "year_season": 2014
    },
    "fashion_size": {
      "size_type": "US",
      "size_description_1": "size",
      "size_1_manufacturer": "90",
      "size_description_2": "top",
      "size_2_manufacturer": "C",
      "size_1": [
        "90"
      ],
      "size_2": [
        "C"
      ]
    }
  }
]

Am using gson-2.2.4.jar

mkobit
  • 43,979
  • 12
  • 156
  • 150

1 Answers1

0

I'm guessing you mean by not writing your own bean for GSON to deserialize to. GSON provides support by having certain JSON types that you can make use of:

Gson gson = new Gson();
final JsonArray jsonElements = gson.fromJson(JSON, JsonArray.class);
mkobit
  • 43,979
  • 12
  • 156
  • 150