{"action":"created","issue":{"url":"https://api.github.com/repos/guzzle/guzzle-services/issues/91","labels_url":"https://api.github.com/repos/guzzle/guzzle-services/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/guzzle/guzzle-services/issues/91/comments","events_url":"https://api.github.com/repos/guzzle/guzzle-services/issues/91/events","html_url":"https://github.com/guzzle/guzzle-services/issues/91","id":101870913,"number":91,"title":"Map null reponse values to defined reponse model properties","user":{"login":"shaun785","id":709929,"avatar_url":"https://avatars.githubusercontent.com/u/709929?v=3","gravatar_id":"","url":"https://api.github.com/users/shaun785","html_url":"https://github.com/shaun785","followers_url":"https://api.github.com/users/shaun785/followers","following_url":"https://api.github.com/users/shaun785/following{/other_user}","gists_url":"https://api.github.com/users/shaun785/gists{/gist_id}","starred_url":"https://api.github.com/users/shaun785/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaun785/subscriptions","organizations_url":"https://api.github.com/users/shaun785/orgs","repos_url":"https://api.github.com/users/shaun785/repos","events_url":"https://api.github.com/users/shaun785/events{/privacy}","received_events_url":"https://api.github.com/users/shaun785/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T11:34:07Z","updated_at":"2016-01-31T05:35:39Z","closed_at":"2016-01-31T05:35:39Z","body":"Hi,\r\n\r\nI have noticed that when a response value for a field is null, the corresponding response model property isn't set. Take the following test for example - \r\n\r\n```javascript\r\n        $hclient = new Client();\r\n        $hclient->getEmitter()->on('before', function (BeforeEvent $event) {\r\n            $json = [\r\n                'data' => [\r\n                    'link' => null\r\n                ]\r\n            ];\r\n            $response = new Response(200, [\r\n                'Content-Type' => 'application/json'\r\n            ], Stream::factory(json_encode($json)));\r\n            $event->intercept($response);\r\n        });\r\n        $description = new Description(\r\n            [\r\n                'operations' => [\r\n                    'foo' => [\r\n                        'uri' => 'http://httpbin.org',\r\n                        'httpMethod' => 'GET',\r\n                        'responseModel' => 'j'\r\n                    ]\r\n                ],\r\n                'models' => [\r\n                    'j' => [\r\n                        'type' => 'object',\r\n                        'location' => 'json',\r\n                        'properties' => [\r\n                            'data' => [\r\n                                'type'          => 'object',\r\n                                'location'      => 'json',\r\n                                'properties'    => [\r\n                                    'link' => [\r\n                                        'name'    => 'val',\r\n                                        'type' => 'string',\r\n                                        'location' => 'json'\r\n                                    ],\r\n                                ],\r\n                                'additionalProperties' => false\r\n                            ]\r\n                        ]\r\n                    ]\r\n                ]\r\n            ]\r\n        );\r\n        $client = new GuzzleClient($hclient, $description);\r\n        $result = $client->foo();\r\n        $expected = [\r\n            'data' => [\r\n                'link' => null\r\n            ]\r\n        ];\r\n        $this->assertEquals($expected, $result);\r\n```\r\nThe above test doesn't pass because link isn't being set. I've looked at the code and src/ResponseLocation/JsonLocation.php (Line 112) is using isset instead of array_key_exists. Is this expected behavior?"},"comment":{"url":"https://api.github.com/repos/guzzle/guzzle-services/issues/comments/177400121","html_url":"https://github.com/guzzle/guzzle-services/issues/91#issuecomment-177400121","issue_url":"https://api.github.com/repos/guzzle/guzzle-services/issues/91","id":177400121,"user":{"login":"jeremeamia","id":107867,"avatar_url":"https://avatars.githubusercontent.com/u/107867?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremeamia","html_url":"https://github.com/jeremeamia","followers_url":"https://api.github.com/users/jeremeamia/followers","following_url":"https://api.github.com/users/jeremeamia/following{/other_user}","gists_url":"https://api.github.com/users/jeremeamia/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremeamia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremeamia/subscriptions","organizations_url":"https://api.github.com/users/jeremeamia/orgs","repos_url":"https://api.github.com/users/jeremeamia/repos","events_url":"https://api.github.com/users/jeremeamia/events{/privacy}","received_events_url":"https://api.github.com/users/jeremeamia/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T05:35:39Z","updated_at":"2016-01-31T05:35:39Z","body":"The referenced PR was merged."}}