@Test
public void testToJsonObjectWithArrayProperties() throws Exception {

	JsonObjectIndexedRecordConverter jsonObjectIndexedRecordConverter =
		getJsonObjectIndexedRecordConverter(
			"/v1.0/catalogs/{siteId}/products", OASConstants.OPERATION_GET,
			readObject("openapi.json"));
	IndexedRecord indexedRecord =
		jsonObjectIndexedRecordConverter.toIndexedRecord(
			readObject("product_with_nested_images_content.json"));
	Object imagesArray = indexedRecord.get(18);
	Assert.assertEquals(
		"Images field type", String.class, imagesArray.getClass());
	IndexedRecordJsonObjectConverter indexedRecordJsonObjectConverter =
		new IndexedRecordJsonObjectConverter(
			true,
			getSchema(
				"/v1.0/catalogs/{siteId}/product",
				OASConstants.OPERATION_POST, readObject("openapi.json")),
			null, new Result());
	JsonObject jsonObject = indexedRecordJsonObjectConverter.toJsonObject(
		indexedRecord);
	JsonArray imagesJsonArray = jsonObject.getJsonArray("images");
	Assert.assertNotNull(imagesJsonArray);
	JsonValue jsonValue = imagesJsonArray.get(0);
	Assert.assertTrue(
		"Array item is JSON object", jsonValue instanceof JsonObject);
	JsonObject itemJsonObject = jsonValue.asJsonObject();
	Assert.assertEquals(
		"attachment value", "U29tZXRleHQsIHRoaXMgaXMgbm90IGltYWdl",
		itemJsonObject.getString("attachment"));
	JsonNumber idJsonNumber = itemJsonObject.getJsonNumber("id");
	Assert.assertEquals("id value", 1977L, idJsonNumber.longValue());
	JsonValue titleJsonValue = itemJsonObject.get("title");
	Assert.assertTrue(
		"Title field  type is JsonObject",
		titleJsonValue instanceof JsonObject);
	JsonObject titleJsonObject = titleJsonValue.asJsonObject();
	Assert.assertEquals(
		"Title field value", "Image of me",
		titleJsonObject.getString("en_US"));
}