Skip to content

Commit c43a02a

Browse files
ilicmsretenantograssiot
authored andcommitted
Remove duplicate data from JSON API include
1 parent 4bf40a3 commit c43a02a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonApi/Serializer/CollectionNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function getItemsData($object, string $format = null, array $context =
9090
$data['data'][] = $item['data'];
9191

9292
if (isset($item['included'])) {
93-
$data['included'] = array_merge($data['included'] ?? [], $item['included']);
93+
$data['included'] = array_unique(array_merge($data['included'] ?? [], $item['included']), SORT_REGULAR);
9494
}
9595
}
9696

0 commit comments

Comments
 (0)