{"action":"created","issue":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/373","labels_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/373/comments","events_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/373/events","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/373","id":29845779,"number":373,"title":"serializing a json array using {} instead of []","user":{"login":"javiern","id":308939,"avatar_url":"https://avatars.githubusercontent.com/u/308939?v=3","gravatar_id":"","url":"https://api.github.com/users/javiern","html_url":"https://github.com/javiern","followers_url":"https://api.github.com/users/javiern/followers","following_url":"https://api.github.com/users/javiern/following{/other_user}","gists_url":"https://api.github.com/users/javiern/gists{/gist_id}","starred_url":"https://api.github.com/users/javiern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiern/subscriptions","organizations_url":"https://api.github.com/users/javiern/orgs","repos_url":"https://api.github.com/users/javiern/repos","events_url":"https://api.github.com/users/javiern/events{/privacy}","received_events_url":"https://api.github.com/users/javiern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":58,"created_at":"2014-03-20T18:39:43Z","updated_at":"2015-08-29T11:04:43Z","closed_at":null,"body":"HI, im using version 1.3, if i call serialize() with something like\r\narray(\r\n   $obj\r\n)\r\n\r\ny get this\r\n\r\n{\"0\": { ****the object serialization****}}\r\n\r\nbut i spect something like this\r\n\r\n[{ ****the object serialization****}]\r\n\r\n\r\ni manage to get it working by commeting this lines on JsonSerializationVisitor class:\r\n\r\n```\r\npublic function endVisitingObject(ClassMetadata $metadata, $data, array $type, Context $context)\r\n    {\r\n        $rs = parent::endVisitingObject($metadata, $data, $type, $context);\r\n        // Force JSON output to \"{}\" instead of \"[]\" if it contains either no properties or all properties are null.\r\n        // if (empty($rs)) {\r\n        //    $rs = new \\ArrayObject();\r\n        //\r\n        //    if (array() === $this->getRoot()) {\r\n        //        $this->setRoot(clone $rs);\r\n        //    }\r\n        //}\r\n\r\n        return $rs;\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/comments/135972455","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/373#issuecomment-135972455","issue_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/373","id":135972455,"user":{"login":"avegao","id":560141,"avatar_url":"https://avatars.githubusercontent.com/u/560141?v=3","gravatar_id":"","url":"https://api.github.com/users/avegao","html_url":"https://github.com/avegao","followers_url":"https://api.github.com/users/avegao/followers","following_url":"https://api.github.com/users/avegao/following{/other_user}","gists_url":"https://api.github.com/users/avegao/gists{/gist_id}","starred_url":"https://api.github.com/users/avegao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avegao/subscriptions","organizations_url":"https://api.github.com/users/avegao/orgs","repos_url":"https://api.github.com/users/avegao/repos","events_url":"https://api.github.com/users/avegao/events{/privacy}","received_events_url":"https://api.github.com/users/avegao/received_events","type":"User","site_admin":false},"created_at":"2015-08-29T11:04:43Z","updated_at":"2015-08-29T11:04:43Z","body":"+1\r\n\r\nIt reproduces when I add two groups or more to an entity"}}