{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/109","repository_url":"https://api.github.com/repos/google/google-api-objectivec-client","labels_url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/109/comments","events_url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/109/events","html_url":"https://github.com/google/google-api-objectivec-client/pull/109","id":114468362,"number":109,"title":"Fix `GTLYouTubeResourceId` allocation","user":{"login":"0xced","id":51363,"avatar_url":"https://avatars.githubusercontent.com/u/51363?v=3","gravatar_id":"","url":"https://api.github.com/users/0xced","html_url":"https://github.com/0xced","followers_url":"https://api.github.com/users/0xced/followers","following_url":"https://api.github.com/users/0xced/following{/other_user}","gists_url":"https://api.github.com/users/0xced/gists{/gist_id}","starred_url":"https://api.github.com/users/0xced/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xced/subscriptions","organizations_url":"https://api.github.com/users/0xced/orgs","repos_url":"https://api.github.com/users/0xced/repos","events_url":"https://api.github.com/users/0xced/events{/privacy}","received_events_url":"https://api.github.com/users/0xced/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/google-api-objectivec-client/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-01T13:00:34Z","updated_at":"2016-04-19T14:53:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/google-api-objectivec-client/pulls/109","html_url":"https://github.com/google/google-api-objectivec-client/pull/109","diff_url":"https://github.com/google/google-api-objectivec-client/pull/109.diff","patch_url":"https://github.com/google/google-api-objectivec-client/pull/109.patch"},"body":"Code that [allocates `GTLObject` instances](https://github.com/google/google-api-objectivec-client/blob/4e1c06132cc88ff81f31e280dc99a38a769603e0/Source/Objects/GTLObject.m#L554-L559) uses the `kind` key to determine which subclass should be allocated. This works well except for `GTLYouTubeResourceId` where the `kind` key doesn’t have the same meaning.\r\n\r\nThe following JSON excerpt allocates a `GTLYouTubeVideo` object instead of a `GTLYouTubeResourceId` object:\r\n\r\n```json\r\n\"resourceId\" : {\r\n    \"kind\" : \"youtube#video\",\r\n    \"videoId\" : \"RjtCS0EEoCY\"\r\n}\r\n```\r\n\r\nOf course using something like `playlistItem.snippet.resourceId.videoId` crashes with the following exception: `-[GTLYouTubeVideo videoId]: unrecognized selector sent to instance 0x7fbce9545330`\r\n\r\nThis commit addresses this issue by ignoring the `kind` key for `GTLYouTubeResourceId` objects.\r\n\r\nFixes #63\r\nFixes #92"},"comment":{"url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/comments/211961599","html_url":"https://github.com/google/google-api-objectivec-client/pull/109#issuecomment-211961599","issue_url":"https://api.github.com/repos/google/google-api-objectivec-client/issues/109","id":211961599,"user":{"login":"0xced","id":51363,"avatar_url":"https://avatars.githubusercontent.com/u/51363?v=3","gravatar_id":"","url":"https://api.github.com/users/0xced","html_url":"https://github.com/0xced","followers_url":"https://api.github.com/users/0xced/followers","following_url":"https://api.github.com/users/0xced/following{/other_user}","gists_url":"https://api.github.com/users/0xced/gists{/gist_id}","starred_url":"https://api.github.com/users/0xced/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xced/subscriptions","organizations_url":"https://api.github.com/users/0xced/orgs","repos_url":"https://api.github.com/users/0xced/repos","events_url":"https://api.github.com/users/0xced/events{/privacy}","received_events_url":"https://api.github.com/users/0xced/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T14:53:14Z","updated_at":"2016-04-19T14:53:14Z","body":"I already have solved it for `GTLYouTubeResourceId` without hardcoding anything. I must still check if the two other classes I found (`GTLFusiontablesStyleFunction` and `GTLBigqueryExplainQueryStep`) are misusing `kind` like YouTube's resource id."}}