Closed GoogleCodeExporter closed 9 years ago
Turn on the library's http logging feature and inspect the types of objects
returned in the server's response.
Look at the objects in the response in the debugger.
Original comment by grobb...@google.com
on 24 May 2014 at 2:01
Original comment by manageiv...@gmail.com
on 24 May 2014 at 7:57
Attachments:
This is a mistake in the YouTube API (internal Google bug number b/10691692).
The API server is returning a resource identifier like this:
"id" : {
"kind" : "youtube#video",
"videoId" : "VxcbppCX6Rk"
}
Normally that would be instantiated into a GTLYouTubeResourceId object, but the
"kind" field tells the client library to instantiate the class with the kind
string "youtube#video", which is GTLYouTubeVideo, so the library properly
creates that object.
As a workaround, you can use the library's surrogates feature to change which
class gets instantiated for the specific query's ticket:
ticket.surrogates = @{ (id)[GTLYouTubeVideo class] : [GTLYouTubeResourceId
class] };
To be notified when and if this is fixed, you can file a separate issue against
the YouTube API to ask the API server developers to fix the "kind" string for
that response. YouTube API issues are filed with the form at
https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%2
0Report)
Please reference the bug number above if you do file an issue.
Original comment by grobb...@google.com
on 30 May 2014 at 2:51
To clarify my previous comment a bit, the API kind string in the server
response is incorrectly telling the library to instantiate the GTLYouTubeVideo
class when the library would otherwise create a GTLYouTubeResourceId object.
That field in the server response should have been named something other than
"kind" to avoid misleading the library.
Original comment by grobb...@google.com
on 30 May 2014 at 3:03
Original issue reported on code.google.com by
mshiban...@gmail.com
on 17 May 2014 at 2:27