@Test public void testParameterSpec() throws JSONException { String jsonString = FileLoader.readString("parser/testParameterSpec.json"); Swagger swagger = OpenAPIParser.parse(jsonString); printSwagger(swagger); assertThat(swagger, is(notNullValue())); assertThat(swagger.getSwagger(), is("2.0")); assertThat(swagger.getBasePath(), is("/parameter/test")); assertThat(swagger.getPaths(), is(notNullValue())); Info info = swagger.getInfo(); assertThat(info.getTitle(), is("Parameter Test Profile")); assertThat(info.getVersion(), is("1.0")); assertThat(info.getDescription(), is("Parameter Test Description")); Path a0 = swagger.getPaths().getPath("/"); assertThat(a0, is(notNullValue())); List<Parameter> parameters = a0.getGet().getParameters(); assertThat(parameters, is(notNullValue())); assertThat(parameters.size(), is(24)); assertThat(parameters.get(0).getName(), is("booleanParam")); assertThat(parameters.get(0).getIn().getName(), is("query")); assertThat(parameters.get(0).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(0)).getType(), is(DataType.BOOLEAN)); assertThat(parameters.get(1).getName(), is("booleanParamWithEnum")); assertThat(parameters.get(1).getIn().getName(), is("query")); assertThat(parameters.get(1).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(1)).getType(), is(DataType.BOOLEAN)); assertThat(((AbstractParameter) parameters.get(1)).getEnum(), is(notNullValue())); assertThat(((AbstractParameter) parameters.get(1)).getEnum().size(), is(2)); assertThat(((AbstractParameter) parameters.get(1)).getEnum().get(0), is(true)); assertThat(((AbstractParameter) parameters.get(1)).getEnum().get(1), is(false)); assertThat(parameters.get(2).getName(), is("integerParam")); assertThat(parameters.get(2).getIn().getName(), is("query")); assertThat(parameters.get(2).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(2)).getType(), is(DataType.INTEGER)); assertThat(parameters.get(3).getName(), is("integerParamWithEnum")); assertThat(parameters.get(3).getIn().getName(), is("query")); assertThat(parameters.get(3).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(3)).getType(), is(DataType.INTEGER)); assertThat(((AbstractParameter) parameters.get(3)).getEnum(), is(notNullValue())); assertThat(((AbstractParameter) parameters.get(3)).getEnum().size(), is(2)); assertThat(((AbstractParameter) parameters.get(3)).getEnum().get(0), is(0)); assertThat(((AbstractParameter) parameters.get(3)).getEnum().get(1), is(1)); assertThat(parameters.get(4).getName(), is("integerParamWithRange")); assertThat(parameters.get(4).getIn().getName(), is("query")); assertThat(parameters.get(4).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(4)).getType(), is(DataType.INTEGER)); assertThat(((AbstractParameter) parameters.get(4)).getMaximum(), is(1)); assertThat(((AbstractParameter) parameters.get(4)).getMinimum(), is(0)); assertThat(((AbstractParameter) parameters.get(4)).isExclusiveMaximum(), is(true)); assertThat(((AbstractParameter) parameters.get(4)).isExclusiveMinimum(), is(true)); assertThat(parameters.get(5).getName(), is("integerParamFormatInt32")); assertThat(parameters.get(5).getIn().getName(), is("query")); assertThat(parameters.get(5).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(5)).getType(), is(DataType.INTEGER)); assertThat(((AbstractParameter) parameters.get(5)).getFormat(), is(DataFormat.INT32)); assertThat(parameters.get(6).getName(), is("integerParamFormatInt64")); assertThat(parameters.get(6).getIn().getName(), is("query")); assertThat(parameters.get(6).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(6)).getType(), is(DataType.INTEGER)); assertThat(((AbstractParameter) parameters.get(6)).getFormat(), is(DataFormat.INT64)); assertThat(parameters.get(7).getName(), is("numberParam")); assertThat(parameters.get(7).getIn().getName(), is("query")); assertThat(parameters.get(7).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(7)).getType(), is(DataType.NUMBER)); assertThat(parameters.get(8).getName(), is("numberParamWithEnum")); assertThat(parameters.get(8).getIn().getName(), is("query")); assertThat(parameters.get(8).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(8)).getType(), is(DataType.NUMBER)); assertThat(((AbstractParameter) parameters.get(8)).getEnum(), is(notNullValue())); assertThat(((AbstractParameter) parameters.get(8)).getEnum().size(), is(2)); assertThat(((AbstractParameter) parameters.get(8)).getEnum().get(0), is(0.5)); assertThat(((AbstractParameter) parameters.get(8)).getEnum().get(1), is(1.5)); assertThat(parameters.get(9).getName(), is("numberParamWithRange")); assertThat(parameters.get(9).getIn().getName(), is("query")); assertThat(parameters.get(9).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(9)).getType(), is(DataType.NUMBER)); assertThat(((AbstractParameter) parameters.get(9)).getMaximum(), is(1.5)); assertThat(((AbstractParameter) parameters.get(9)).getMinimum(), is(0.5)); assertThat(((AbstractParameter) parameters.get(9)).isExclusiveMaximum(), is(true)); assertThat(((AbstractParameter) parameters.get(9)).isExclusiveMinimum(), is(true)); assertThat(parameters.get(10).getName(), is("numberParamFormatFloat")); assertThat(parameters.get(10).getIn().getName(), is("query")); assertThat(parameters.get(10).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(10)).getType(), is(DataType.NUMBER)); assertThat(((AbstractParameter) parameters.get(10)).getFormat(), is(DataFormat.FLOAT)); assertThat(parameters.get(11).getName(), is("numberParamFormatDouble")); assertThat(parameters.get(11).getIn().getName(), is("query")); assertThat(parameters.get(11).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(11)).getType(), is(DataType.NUMBER)); assertThat(((AbstractParameter) parameters.get(11)).getFormat(), is(DataFormat.DOUBLE)); assertThat(parameters.get(12).getName(), is("stringParam")); assertThat(parameters.get(12).getIn().getName(), is("query")); assertThat(parameters.get(12).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(12)).getType(), is(DataType.STRING)); assertThat(parameters.get(13).getName(), is("stringParamWithEnum")); assertThat(parameters.get(13).getIn().getName(), is("query")); assertThat(parameters.get(13).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(13)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(13)).getEnum(), is(notNullValue())); assertThat(((AbstractParameter) parameters.get(13)).getEnum().size(), is(3)); assertThat(((AbstractParameter) parameters.get(13)).getEnum().get(0), is("a")); assertThat(((AbstractParameter) parameters.get(13)).getEnum().get(1), is("b")); assertThat(((AbstractParameter) parameters.get(13)).getEnum().get(2), is("c")); assertThat(parameters.get(14).getName(), is("stringParamWithRange")); assertThat(parameters.get(14).getIn().getName(), is("query")); assertThat(parameters.get(14).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(14)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(14)).getMaxLength(), is(1)); assertThat(((AbstractParameter) parameters.get(14)).getMinLength(), is(0)); assertThat(parameters.get(15).getName(), is("stringParamFormatText")); assertThat(parameters.get(15).getIn().getName(), is("query")); assertThat(parameters.get(15).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(15)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(15)).getFormat(), is(DataFormat.TEXT)); assertThat(parameters.get(16).getName(), is("stringParamFormatByte")); assertThat(parameters.get(16).getIn().getName(), is("query")); assertThat(parameters.get(16).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(16)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(16)).getFormat(), is(DataFormat.BYTE)); assertThat(parameters.get(17).getName(), is("stringParamFormatBinary")); assertThat(parameters.get(17).getIn().getName(), is("query")); assertThat(parameters.get(17).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(17)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(17)).getFormat(), is(DataFormat.BINARY)); assertThat(parameters.get(18).getName(), is("stringParamFormatDate")); assertThat(parameters.get(18).getIn().getName(), is("query")); assertThat(parameters.get(18).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(18)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(18)).getFormat(), is(DataFormat.DATE)); assertThat(parameters.get(19).getName(), is("stringParamFormatDateTime")); assertThat(parameters.get(19).getIn().getName(), is("query")); assertThat(parameters.get(19).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(19)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(19)).getFormat(), is(DataFormat.DATE_TIME)); assertThat(parameters.get(20).getName(), is("stringParamFormatPassword")); assertThat(parameters.get(20).getIn().getName(), is("query")); assertThat(parameters.get(20).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(20)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(20)).getFormat(), is(DataFormat.PASSWORD)); assertThat(parameters.get(21).getName(), is("stringParamFormatRGB")); assertThat(parameters.get(21).getIn().getName(), is("query")); assertThat(parameters.get(21).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(21)).getType(), is(DataType.STRING)); assertThat(((AbstractParameter) parameters.get(21)).getFormat(), is(DataFormat.RGB)); assertThat(parameters.get(22).getName(), is("arrayParam")); assertThat(parameters.get(22).getIn().getName(), is("query")); assertThat(parameters.get(22).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(22)).getType(), is(DataType.ARRAY)); assertThat(parameters.get(23).getName(), is("arrayParamWithInteger")); assertThat(parameters.get(23).getIn().getName(), is("query")); assertThat(parameters.get(23).isRequired(), is(true)); assertThat(((AbstractParameter) parameters.get(23)).getType(), is(DataType.ARRAY)); assertThat(((AbstractParameter) parameters.get(23)).getItems(), is(notNullValue())); assertThat(((AbstractParameter) parameters.get(23)).getItems().getType(), is(DataType.INTEGER)); }
public static Swagger parse(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); Swagger swagger = new Swagger(); for (Iterator<String> it = jsonObject.keys(); it.hasNext();) { String key = it.next(); Object object = jsonObject.get(key); if (object != null) { if ("swagger".equalsIgnoreCase(key)) { swagger.setSwagger((String) object); } else if ("basePath".equalsIgnoreCase(key)) { swagger.setBasePath((String) object); } else if ("host".equalsIgnoreCase(key)) { swagger.setHost((String) object); } else if ("info".equalsIgnoreCase(key)) { swagger.setInfo(parseInfo((JSONObject) object)); } else if ("schemes".equalsIgnoreCase(key)) { swagger.setSchemes(parseStringArray((JSONArray) object)); } else if ("consumes".equalsIgnoreCase(key)) { swagger.setConsumes(parseStringArray((JSONArray) object)); } else if ("produces".equalsIgnoreCase(key)) { swagger.setProduces(parseStringArray((JSONArray) object)); } else if ("paths".equalsIgnoreCase(key)) { swagger.setPaths(parsePaths((JSONObject) object)); } else if ("definitions".equalsIgnoreCase(key)) { swagger.setDefinitions(parseDefinitions((JSONObject) object)); } else if ("parameters".equalsIgnoreCase(key)) { swagger.setParameters(parseParameters((JSONObject) object)); } else if ("responses".equalsIgnoreCase(key)) { swagger.setResponses(parseResponsesWithRoot((JSONObject) object)); } else if ("securityDefinitions".equalsIgnoreCase(key)) { swagger.setSecurityDefinitions(parseSecurityDefinitions((JSONObject) object)); } else if ("security".equalsIgnoreCase(key)) { swagger.setSecurityRequirement(parseSecurity((JSONObject) object)); } else if ("tags".equalsIgnoreCase(key)) { swagger.setTags(parseTags((JSONArray) object)); } else if ("externalDocs".equalsIgnoreCase(key)) { swagger.setExternalDocs(parseExternalDocs((JSONObject) object)); } else if (key.startsWith("x-")) { swagger.addVendorExtension(key, parseVendorExtension(object)); } } } if (swagger.getSwagger() == null) { throw new IllegalArgumentException("swagger does not exist."); } if (!swagger.getSwagger().equalsIgnoreCase("2.0")) { throw new IllegalArgumentException("swagger is invalid."); } if (swagger.getInfo() == null) { throw new IllegalArgumentException("info does not exist."); } if (swagger.getPaths() == null) { throw new IllegalArgumentException("paths does not exist."); } return swagger; }
OpenAPIParser { public static Swagger parse(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); Swagger swagger = new Swagger(); for (Iterator<String> it = jsonObject.keys(); it.hasNext();) { String key = it.next(); Object object = jsonObject.get(key); if (object != null) { if ("swagger".equalsIgnoreCase(key)) { swagger.setSwagger((String) object); } else if ("basePath".equalsIgnoreCase(key)) { swagger.setBasePath((String) object); } else if ("host".equalsIgnoreCase(key)) { swagger.setHost((String) object); } else if ("info".equalsIgnoreCase(key)) { swagger.setInfo(parseInfo((JSONObject) object)); } else if ("schemes".equalsIgnoreCase(key)) { swagger.setSchemes(parseStringArray((JSONArray) object)); } else if ("consumes".equalsIgnoreCase(key)) { swagger.setConsumes(parseStringArray((JSONArray) object)); } else if ("produces".equalsIgnoreCase(key)) { swagger.setProduces(parseStringArray((JSONArray) object)); } else if ("paths".equalsIgnoreCase(key)) { swagger.setPaths(parsePaths((JSONObject) object)); } else if ("definitions".equalsIgnoreCase(key)) { swagger.setDefinitions(parseDefinitions((JSONObject) object)); } else if ("parameters".equalsIgnoreCase(key)) { swagger.setParameters(parseParameters((JSONObject) object)); } else if ("responses".equalsIgnoreCase(key)) { swagger.setResponses(parseResponsesWithRoot((JSONObject) object)); } else if ("securityDefinitions".equalsIgnoreCase(key)) { swagger.setSecurityDefinitions(parseSecurityDefinitions((JSONObject) object)); } else if ("security".equalsIgnoreCase(key)) { swagger.setSecurityRequirement(parseSecurity((JSONObject) object)); } else if ("tags".equalsIgnoreCase(key)) { swagger.setTags(parseTags((JSONArray) object)); } else if ("externalDocs".equalsIgnoreCase(key)) { swagger.setExternalDocs(parseExternalDocs((JSONObject) object)); } else if (key.startsWith("x-")) { swagger.addVendorExtension(key, parseVendorExtension(object)); } } } if (swagger.getSwagger() == null) { throw new IllegalArgumentException("swagger does not exist."); } if (!swagger.getSwagger().equalsIgnoreCase("2.0")) { throw new IllegalArgumentException("swagger is invalid."); } if (swagger.getInfo() == null) { throw new IllegalArgumentException("info does not exist."); } if (swagger.getPaths() == null) { throw new IllegalArgumentException("paths does not exist."); } return swagger; } }
OpenAPIParser { public static Swagger parse(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); Swagger swagger = new Swagger(); for (Iterator<String> it = jsonObject.keys(); it.hasNext();) { String key = it.next(); Object object = jsonObject.get(key); if (object != null) { if ("swagger".equalsIgnoreCase(key)) { swagger.setSwagger((String) object); } else if ("basePath".equalsIgnoreCase(key)) { swagger.setBasePath((String) object); } else if ("host".equalsIgnoreCase(key)) { swagger.setHost((String) object); } else if ("info".equalsIgnoreCase(key)) { swagger.setInfo(parseInfo((JSONObject) object)); } else if ("schemes".equalsIgnoreCase(key)) { swagger.setSchemes(parseStringArray((JSONArray) object)); } else if ("consumes".equalsIgnoreCase(key)) { swagger.setConsumes(parseStringArray((JSONArray) object)); } else if ("produces".equalsIgnoreCase(key)) { swagger.setProduces(parseStringArray((JSONArray) object)); } else if ("paths".equalsIgnoreCase(key)) { swagger.setPaths(parsePaths((JSONObject) object)); } else if ("definitions".equalsIgnoreCase(key)) { swagger.setDefinitions(parseDefinitions((JSONObject) object)); } else if ("parameters".equalsIgnoreCase(key)) { swagger.setParameters(parseParameters((JSONObject) object)); } else if ("responses".equalsIgnoreCase(key)) { swagger.setResponses(parseResponsesWithRoot((JSONObject) object)); } else if ("securityDefinitions".equalsIgnoreCase(key)) { swagger.setSecurityDefinitions(parseSecurityDefinitions((JSONObject) object)); } else if ("security".equalsIgnoreCase(key)) { swagger.setSecurityRequirement(parseSecurity((JSONObject) object)); } else if ("tags".equalsIgnoreCase(key)) { swagger.setTags(parseTags((JSONArray) object)); } else if ("externalDocs".equalsIgnoreCase(key)) { swagger.setExternalDocs(parseExternalDocs((JSONObject) object)); } else if (key.startsWith("x-")) { swagger.addVendorExtension(key, parseVendorExtension(object)); } } } if (swagger.getSwagger() == null) { throw new IllegalArgumentException("swagger does not exist."); } if (!swagger.getSwagger().equalsIgnoreCase("2.0")) { throw new IllegalArgumentException("swagger is invalid."); } if (swagger.getInfo() == null) { throw new IllegalArgumentException("info does not exist."); } if (swagger.getPaths() == null) { throw new IllegalArgumentException("paths does not exist."); } return swagger; } private  OpenAPIParser(); }
OpenAPIParser { public static Swagger parse(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); Swagger swagger = new Swagger(); for (Iterator<String> it = jsonObject.keys(); it.hasNext();) { String key = it.next(); Object object = jsonObject.get(key); if (object != null) { if ("swagger".equalsIgnoreCase(key)) { swagger.setSwagger((String) object); } else if ("basePath".equalsIgnoreCase(key)) { swagger.setBasePath((String) object); } else if ("host".equalsIgnoreCase(key)) { swagger.setHost((String) object); } else if ("info".equalsIgnoreCase(key)) { swagger.setInfo(parseInfo((JSONObject) object)); } else if ("schemes".equalsIgnoreCase(key)) { swagger.setSchemes(parseStringArray((JSONArray) object)); } else if ("consumes".equalsIgnoreCase(key)) { swagger.setConsumes(parseStringArray((JSONArray) object)); } else if ("produces".equalsIgnoreCase(key)) { swagger.setProduces(parseStringArray((JSONArray) object)); } else if ("paths".equalsIgnoreCase(key)) { swagger.setPaths(parsePaths((JSONObject) object)); } else if ("definitions".equalsIgnoreCase(key)) { swagger.setDefinitions(parseDefinitions((JSONObject) object)); } else if ("parameters".equalsIgnoreCase(key)) { swagger.setParameters(parseParameters((JSONObject) object)); } else if ("responses".equalsIgnoreCase(key)) { swagger.setResponses(parseResponsesWithRoot((JSONObject) object)); } else if ("securityDefinitions".equalsIgnoreCase(key)) { swagger.setSecurityDefinitions(parseSecurityDefinitions((JSONObject) object)); } else if ("security".equalsIgnoreCase(key)) { swagger.setSecurityRequirement(parseSecurity((JSONObject) object)); } else if ("tags".equalsIgnoreCase(key)) { swagger.setTags(parseTags((JSONArray) object)); } else if ("externalDocs".equalsIgnoreCase(key)) { swagger.setExternalDocs(parseExternalDocs((JSONObject) object)); } else if (key.startsWith("x-")) { swagger.addVendorExtension(key, parseVendorExtension(object)); } } } if (swagger.getSwagger() == null) { throw new IllegalArgumentException("swagger does not exist."); } if (!swagger.getSwagger().equalsIgnoreCase("2.0")) { throw new IllegalArgumentException("swagger is invalid."); } if (swagger.getInfo() == null) { throw new IllegalArgumentException("info does not exist."); } if (swagger.getPaths() == null) { throw new IllegalArgumentException("paths does not exist."); } return swagger; } private  OpenAPIParser(); static Swagger parse(String jsonString); @SuppressWarnings("unchecked") static Bundle parseJSONObject(JSONObject jsonObject); @SuppressWarnings("unchecked") static ArrayList parseJSONArray(JSONArray jsonArray); }
OpenAPIParser { public static Swagger parse(String jsonString) throws JSONException { JSONObject jsonObject = new JSONObject(jsonString); Swagger swagger = new Swagger(); for (Iterator<String> it = jsonObject.keys(); it.hasNext();) { String key = it.next(); Object object = jsonObject.get(key); if (object != null) { if ("swagger".equalsIgnoreCase(key)) { swagger.setSwagger((String) object); } else if ("basePath".equalsIgnoreCase(key)) { swagger.setBasePath((String) object); } else if ("host".equalsIgnoreCase(key)) { swagger.setHost((String) object); } else if ("info".equalsIgnoreCase(key)) { swagger.setInfo(parseInfo((JSONObject) object)); } else if ("schemes".equalsIgnoreCase(key)) { swagger.setSchemes(parseStringArray((JSONArray) object)); } else if ("consumes".equalsIgnoreCase(key)) { swagger.setConsumes(parseStringArray((JSONArray) object)); } else if ("produces".equalsIgnoreCase(key)) { swagger.setProduces(parseStringArray((JSONArray) object)); } else if ("paths".equalsIgnoreCase(key)) { swagger.setPaths(parsePaths((JSONObject) object)); } else if ("definitions".equalsIgnoreCase(key)) { swagger.setDefinitions(parseDefinitions((JSONObject) object)); } else if ("parameters".equalsIgnoreCase(key)) { swagger.setParameters(parseParameters((JSONObject) object)); } else if ("responses".equalsIgnoreCase(key)) { swagger.setResponses(parseResponsesWithRoot((JSONObject) object)); } else if ("securityDefinitions".equalsIgnoreCase(key)) { swagger.setSecurityDefinitions(parseSecurityDefinitions((JSONObject) object)); } else if ("security".equalsIgnoreCase(key)) { swagger.setSecurityRequirement(parseSecurity((JSONObject) object)); } else if ("tags".equalsIgnoreCase(key)) { swagger.setTags(parseTags((JSONArray) object)); } else if ("externalDocs".equalsIgnoreCase(key)) { swagger.setExternalDocs(parseExternalDocs((JSONObject) object)); } else if (key.startsWith("x-")) { swagger.addVendorExtension(key, parseVendorExtension(object)); } } } if (swagger.getSwagger() == null) { throw new IllegalArgumentException("swagger does not exist."); } if (!swagger.getSwagger().equalsIgnoreCase("2.0")) { throw new IllegalArgumentException("swagger is invalid."); } if (swagger.getInfo() == null) { throw new IllegalArgumentException("info does not exist."); } if (swagger.getPaths() == null) { throw new IllegalArgumentException("paths does not exist."); } return swagger; } private  OpenAPIParser(); static Swagger parse(String jsonString); @SuppressWarnings("unchecked") static Bundle parseJSONObject(JSONObject jsonObject); @SuppressWarnings("unchecked") static ArrayList parseJSONArray(JSONArray jsonArray);  }