Skip to content

Commit

Permalink
add @id after serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDomin committed Mar 26, 2021
1 parent 5b7777c commit 47965c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Sylius/Bundle/ApiBundle/Serializer/ProductSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public function normalize($object, $format = null, array $context = [])
}
}

return $this->objectNormalizer->normalize($object, $format, $context);
$data = $this->objectNormalizer->normalize($object, $format, $context);
$data['@id'] = $object->getId();

return $data;
}

public function supportsNormalization($data, $format = null, $context = []): bool
Expand Down

0 comments on commit 47965c3

Please sign in to comment.