facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
210 stars 160 forks source link

FieldTypes issue related to Ad Account Delivery Estimate #13

Closed euisan closed 4 years ago

euisan commented 7 years ago

When I request delivery_estimate from edges of ad_account, it raised TypeError. estimate_dau and estimate_mau in Ad Account Delivery Estimate defined as object like below, but both fields returned as integer from API.

https://github.com/facebook/facebook-ruby-ads-sdk/blob/b704d31bb0a94596078e05cb08fbe4d17732c7d1/lib/facebook_ads/ad_objects/ad_account_delivery_estimate.rb#L54 https://github.com/facebook/facebook-ruby-ads-sdk/blob/b704d31bb0a94596078e05cb08fbe4d17732c7d1/lib/facebook_ads/ad_objects/ad_account_delivery_estimate.rb#L55

Other types (like string_type or list) has several ways to handling if inputted different type of value what you expected are inputted. but object type is not, it's always trying parse JSON. bid_estimate defined as object, and it occurred TypeError too. because bid_estimate already has Hash at this point, not JSON string.

I tried like below...

ad_account = FacebookAds::AdAccount.get(<AD_ACCOUNT_ID>, <SESSION>)
ad_account.delivery_estimate(<REQUIRED_PARAMS>).first

# TypeError: no implicit conversion of Hash into String
# from /Users/san/.rvm/gems/ruby-2.3.4/gems/json-1.8.6/lib/json/common.rb:155:in `initialize'
stale[bot] commented 4 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.