{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/20837","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/20837/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/20837/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/20837/events","html_url":"https://github.com/symfony/symfony/issues/20837","id":194422270,"number":20837,"title":"ArrayDenormalizer::supportsDenormalization, array denormalizer ","user":{"login":"murat11","id":10486500,"avatar_url":"https://avatars.githubusercontent.com/u/10486500?v=3","gravatar_id":"","url":"https://api.github.com/users/murat11","html_url":"https://github.com/murat11","followers_url":"https://api.github.com/users/murat11/followers","following_url":"https://api.github.com/users/murat11/following{/other_user}","gists_url":"https://api.github.com/users/murat11/gists{/gist_id}","starred_url":"https://api.github.com/users/murat11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murat11/subscriptions","organizations_url":"https://api.github.com/users/murat11/orgs","repos_url":"https://api.github.com/users/murat11/repos","events_url":"https://api.github.com/users/murat11/events{/privacy}","received_events_url":"https://api.github.com/users/murat11/received_events","type":"User","site_admin":false},"labels":[{"id":100079,"url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":99939,"url":"https://api.github.com/repos/symfony/symfony/labels/Serializer","name":"Serializer","color":"DDDDDD","default":false},{"id":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-12-08T19:26:09Z","updated_at":"2016-12-16T07:02:27Z","closed_at":null,"body":"The code from [Here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php#L70)\r\n\r\n```\r\n    public function supportsDenormalization($data, $type, $format = null)\r\n    {\r\n        return substr($type, -2) === '[]'\r\n            && $this->serializer->supportsDenormalization($data, substr($type, 0, -2), $format);\r\n    }\r\n```\r\n\r\nWhy the array is sent to `$this->serializer->supportsDenormalization`? Should not we send the item of array? Or it's supposed that my _object denormalizer_ checks arrays also?\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/267530801","html_url":"https://github.com/symfony/symfony/issues/20837#issuecomment-267530801","issue_url":"https://api.github.com/repos/symfony/symfony/issues/20837","id":267530801,"user":{"login":"murat11","id":10486500,"avatar_url":"https://avatars.githubusercontent.com/u/10486500?v=3","gravatar_id":"","url":"https://api.github.com/users/murat11","html_url":"https://github.com/murat11","followers_url":"https://api.github.com/users/murat11/followers","following_url":"https://api.github.com/users/murat11/following{/other_user}","gists_url":"https://api.github.com/users/murat11/gists{/gist_id}","starred_url":"https://api.github.com/users/murat11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murat11/subscriptions","organizations_url":"https://api.github.com/users/murat11/orgs","repos_url":"https://api.github.com/users/murat11/repos","events_url":"https://api.github.com/users/murat11/events{/privacy}","received_events_url":"https://api.github.com/users/murat11/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T07:02:27Z","updated_at":"2016-12-16T07:02:27Z","body":"Ok. Thank you all, guys. \r\nIt seems I get some better understanding of this subject. \r\n`supportsDenormalization` is not the right place for things like \r\n```\r\n        if (!is_object($object)) {\r\n            return false;\r\n        }\r\n        if (!isset($object->id)) {\r\n            return false;\r\n        }\r\n        if (!isset($object->name)) {\r\n            return false;\r\n        }\r\n```\r\nBut  method signature with `$data` in arguments made me confused and it possibly will confuse others. \r\n\r\nI wanted to ask one more thing: \r\nWhere is the right place on the web where I can ask questions related with Serializer and other Symfony component? \r\n\r\nRight away I'm not sure about following: [Here the place](https://github.com/goalapi/symfony-sdk/blob/master/GoalAPISDK/Serializer/Normalizer/TournamentDenormalizer.php#L65) where I'm doing denormalization of nested objects. In the example it \"hopes\" that `->denormalizer` knows how to denormalize Territory i.e all job is done using `Symfony\\Component\\Serializer\\Serializer` class  like here: \r\n```\r\n       use Symfony\\Component\\Serializer\\Serializer;\r\n\r\n        $serializer = new Serializer(\r\n            [\r\n                new Denormalizer\\ArrayDenormalizer(),\r\n                new TournamentDenormalizer(),\r\n                new TerritoryDenormalizer()\r\n            ]\r\n        );\r\n       $serializer->denormalize($data, Tournament::class);\r\n``` \r\nIs it good approach? Should not I explicitly specify dependencies for `TournamentDenormalizer`? Like\r\n```\r\n$tournamentDenormalizer->setTerritoryDenormalizer(new TerritoryDenormalizer());\r\n```\r\n"}}
{"actor":{"display_login":"murat11"}}