code: private static String extractTopItem(String searchString, String schema, int startIdx) {
  		String extracted = null;
  		int propIdx = schema.indexOf("\"properties\"", startIdx);
  		if (propIdx == -1) {
  			propIdx = Integer.MAX_VALUE;
  		}
  		// check for second
  		int idIdx = schema.indexOf("\"" + searchString + "\"", startIdx);
  		int secondIdIdx = schema.indexOf("\"" + searchString + "\"", idIdx + 1);
  		if (secondIdIdx != -1 && propIdx > secondIdIdx) {
  			idIdx = secondIdIdx;
  		}
  		if (idIdx != -1 && propIdx > idIdx) { // make sure we're not in a nested
  												// id
  			// find the 1st and second " after the idx
  			int valueStartIdx = schema.indexOf("\"", idIdx + (searchString.length() + 2));
  			int valueEndIdx = schema.indexOf("\"", valueStartIdx + 1);
  			extracted = schema.substring(valueStartIdx + 1, valueEndIdx);
  		}
  		return extracted;
  	}
docs: Extracts the value of a specified parameter in a schema
  
  @param searchString
  element to search for
  @param schema
  Schema as a string
  @return the value or null if not found