ModelValue mv = list.get(i);
String field = "attributes["+i+"]"; // Used for error reporting
if (mv.getValueType() != ModelValue.ModelValueType.OBJECT) {
throw invalidType(mv, ModelValue.ModelValueType.OBJECT, field);
}
ModelObject attrModel = mv.asValue(ModelObject.class);
if (!attrModel.hasDefined("key")) {
throw requiredField(field, "key");
}
String key = get(attrModel, ModelString.class, "key").getValue();
if (!attrModel.has("value")) {