Skip to content

Commit 8a66142

Browse files
committed
MAGETWO-56206: API - inconsistency in the Magento response data types
- Replace forced object change to instead skip empty extension_attributes (documented as optional)
1 parent a27e318 commit 8a66142

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/Magento/Framework/Reflection/DataObjectProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public function buildOutputDataArray($dataObject, $dataObjectType)
9797
if ($key === CustomAttributesDataInterface::CUSTOM_ATTRIBUTES) {
9898
$value = $this->customAttributesProcessor->buildOutputDataArray($dataObject, $dataObjectType);
9999
} elseif ($key === "extension_attributes") {
100-
$attributeArray = $this->extensionAttributesProcessor->buildOutputDataArray($value, $returnType);
101-
if (!empty($attributeArray)) {
102-
$value = $attributeArray;
100+
$value = $this->extensionAttributesProcessor->buildOutputDataArray($value, $returnType);
101+
if (empty($value)) {
102+
continue;
103103
}
104104
} else {
105105
if (is_object($value) && !($value instanceof Phrase)) {

0 commit comments

Comments
 (0)