-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AdMob API undefined method `has_key?' for #<Array:0x007fbf08109568> #902
Comments
Unfortunately this isn't something we can fix in the client. The GenerateNetworkReport call is a streaming call, which is not described correctly in the API specification (discovery document), and so the client can't tell it's supposed to be an array. |
Ok. Who is responsible for the API specification?
On Tue, 8 Sep 2020 at 22:21 Daniel Azuma ***@***.***> wrote:
Unfortunately this isn't something we can fix in the client. The
GenerateNetworkReport call is a streaming call, which is not described
correctly in the API specification (discovery document), and so the client
can't tell it's supposed to be an array.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#902 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHE6KBHSKMK7SI5KYXRYMTSE3KCTANCNFSM4QTEXCWQ>
.
--
j^_^j
|
+1 Having the same issue. |
👋 Greetings @jonasmora, for technical discussions with developers and members of the AdMob API team, visit the Google AdMob API Technical Forum. I'm going to close this issue because the folks who own this repo have no actionable way to resolve it directly, but please let us know if there's anything we can do to help! |
Reopening as it remains an issue, and we're tracking an active internal effort to address it internally. |
As a workaround I did this Google::Apis::AdmobV1::GenerateMediationReportResponse.class_eval do
attr_accessor :rows
end
Google::Apis::AdmobV1::GenerateMediationReportResponse::Representation.class_eval do
def from_json(data, *args)
data = MultiJson.load(data)
new_data = {}
data.each do |datum|
if datum.has_key? 'header'
new_data['header'] = datum['header']
elsif datum.has_key? 'row'
new_data['rows'] ||= []
new_data['rows'] << datum['row']
elsif datum.has_key? 'footer'
new_data['footer'] = datum['footer']
end
end
from_hash(new_data, *args)
end
collection :rows, as: 'rows', class: Google::Apis::AdmobV1::ReportRow, decorator: Google::Apis::AdmobV1::ReportRow::Representation
end |
Environment details
Steps to reproduce
Code example
In this line:
from /Users/jonas/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/representable-3.0.4/lib/representable/json.rb:39:in `from_json'
The code assumes data is a hash but it receives an array
The text was updated successfully, but these errors were encountered: