diff --git a/src/lib/Output/Generator/Json.php b/src/lib/Output/Generator/Json.php index fa22860b..37d8b810 100644 --- a/src/lib/Output/Generator/Json.php +++ b/src/lib/Output/Generator/Json.php @@ -143,7 +143,7 @@ public function startObjectElement($name, $mediaTypeName = null) $object = new Json\JsonObject($this->json); - if ($this->json instanceof Json\ArrayObject) { + if ($this->json instanceof Json\ArrayObject || $this->json instanceof Data\ArrayList) { $this->json->append($object); $this->json = $object; } else { diff --git a/src/lib/Output/Normalizer/ArrayObjectNormalizer.php b/src/lib/Output/Normalizer/ArrayObjectNormalizer.php index 9b5af3de..948b6d56 100644 --- a/src/lib/Output/Normalizer/ArrayObjectNormalizer.php +++ b/src/lib/Output/Normalizer/ArrayObjectNormalizer.php @@ -21,8 +21,6 @@ public function normalize($object, ?string $format = null, array $context = []): { $data = get_object_vars($object); - unset($data['_ref_parent']); - foreach ($data as $key => $value) { $data[$key] = $this->normalize($value, $format, $context); } diff --git a/src/lib/Output/Normalizer/JsonObjectNormalizer.php b/src/lib/Output/Normalizer/JsonObjectNormalizer.php index bb2dc785..f76fbb04 100644 --- a/src/lib/Output/Normalizer/JsonObjectNormalizer.php +++ b/src/lib/Output/Normalizer/JsonObjectNormalizer.php @@ -25,8 +25,6 @@ public function normalize($object, ?string $format = null, array $context = []): { $vars = get_object_vars($object); - unset($vars['_ref_parent']); - foreach ($vars as $name => $value) { $vars[$name] = $this->normalizer->normalize($value, $format, $context); }