Skip to content

Commit

Permalink
Serializer fork to fix issue schmittjoh#373
Browse files Browse the repository at this point in the history
  • Loading branch information
j-ledoux committed Jun 5, 2015
1 parent 363186a commit 7b1378a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/JMS/Serializer/JsonSerializationVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public function endVisitingObject(ClassMetadata $metadata, $data, array $type, C
{
$rs = parent::endVisitingObject($metadata, $data, $type, $context);

/**
* Fix array serialized as object issue
* @see https://github.com/schmittjoh/JMSSerializerBundle/issues/373
*/
return $rs;

// Force JSON output to "{}" instead of "[]" if it contains either no properties or all properties are null.
if (empty($rs)) {
$rs = new \ArrayObject();
Expand Down

0 comments on commit 7b1378a

Please # to comment.