Skip to content

Commit

Permalink
Merge pull request #282 from art-community/fix/json-parsing-2
Browse files Browse the repository at this point in the history
Fixed json parsing
  • Loading branch information
Anton Bashirov authored May 13, 2020
2 parents d6f130e + 7250a05 commit 8174d1a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,12 @@ private Collection<CollectionValue<Entity>> parseArraysArray(JsonParser parser)
List<CollectionValue<Entity>> array = dynamicArrayOf();
JsonToken currentToken = parser.currentToken();
do {
Collection<Entity> entities = dynamicArrayOf();
if (currentToken != START_ARRAY) {
entities = parseEntityArray(parser);
array.add(entityCollection(parseEntityArray(parser)));
}
currentToken = parser.nextToken();
if (currentToken == END_ARRAY) {
array.add(entityCollection(entities));
if (currentToken == END_ARRAY && isEmpty(array)) {
array.add(entityCollection(dynamicArrayOf()));
}
} while (!parser.isClosed() && currentToken != END_ARRAY);
return array;
Expand Down

0 comments on commit 8174d1a

Please sign in to comment.