Skip to content

Commit

Permalink
add support for parsing simple arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv committed Aug 10, 2016
1 parent cc1fbf0 commit af4a73a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Frameworks/EOF/ERRest/Sources/er/rest/ERXRestRequestNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,11 @@ protected String entityName(String suggestedEntityName) {
if (entityName == null) {
entityName = type();
if (entityName == null && value() == null) {
entityName = "NSDictionary";
if (isArray()) {
entityName = "NSMutableArray";
} else {
entityName = "NSDictionary";
}
}
}
return entityName;
Expand Down Expand Up @@ -1191,7 +1195,11 @@ public void updateObjectWithFilter(Object obj, ERXKeyFilter keyFilter, ERXRestCo
}
}

if (List.class.isAssignableFrom(valueType) && keyFilter.matches(key, ERXKey.Type.ToManyRelationship)) {
if (keyName == null && isArray()) {
Object value = ERXRestUtils.coerceValueToTypeNamed(childNode.value(), valueType.getCanonicalName(), context, true);
((List<Object>)obj).add(value);
}
else if (List.class.isAssignableFrom(valueType) && keyFilter.matches(key, ERXKey.Type.ToManyRelationship)) {
EOClassDescription destinationClassDescription;
// this is sort of expensive, but we want to support non-eomodel to-many relationships on EO's, so
// we fallback and lookup the class entity ...
Expand Down

0 comments on commit af4a73a

Please sign in to comment.