ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

The client doesn't supports multiple parameters with the same name, needed for Adsense Mgmt API #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to request a report to adsense management api, using multiple dimensions 
http://code.google.com/apis/adsense/management/v1/reference.html#collection_repo
rts
2.
3.

What is the expected output? What do you see instead?

only the first metric or dimension passed is used

What version of the product are you using? On what operating system?

google-api-ruby-client 3.0, linux

Please provide any additional information below.

The problem is in normalize_parameters, there's even a comment there:

      def normalize_parameters(parameters={})
        # Convert keys to Strings when appropriate
        if parameters.kind_of?(Hash) || parameters.kind_of?(Array)
          # Is a Hash or an Array a better return type?  Do we ever need to
          # worry about the same parameter being sent twice with different
          # values?

(yes, we need :)

Thanks

Original issue reported on code.google.com by martin.s...@gmail.com on 2 Nov 2011 at 4:06

GoogleCodeExporter commented 9 years ago
I've fixed it here 
http://code.google.com/r/martinsarsale-support-for-repeats/source/detail?r=01229
ff71038431d2e60a278978ca81a614e1091 feel free to pull the changes.

I ran the tests and I had 3 errors, but I still had them with the original 
version.

Thanks

Original comment by martin.s...@gmail.com on 2 Nov 2011 at 8:28

GoogleCodeExporter commented 9 years ago
Bob: have you see my fork? do you have any comments? 

Thanks

Original comment by martin.s...@gmail.com on 30 Nov 2011 at 2:27

GoogleCodeExporter commented 9 years ago
I didn't see it actually, but it looks pretty good. Could you add a test to 
verify that this fixes the bug though?

Original comment by sporkmonger on 30 Nov 2011 at 5:58

GoogleCodeExporter commented 9 years ago
Well, I'm not sure what other service apart from Adsense Management API needs 
repeated parameters; and that API is for unauthenticated use...
Any hints?

Thanks

Original comment by martin.s...@gmail.com on 30 Nov 2011 at 6:25

GoogleCodeExporter commented 9 years ago
Oh, you don't need to hit an API in the test. Make it a unit test, not an 
integration test. Just make the call to generate a request object, then inspect 
the request object to make sure it created a request against the correct URI.

Original comment by sporkmonger on 1 Dec 2011 at 6:01

GoogleCodeExporter commented 9 years ago
Please see 
http://code.google.com/r/martinsarsale-support-for-repeats/source/detail?r=ed474
2d8d47260cc84d40a42d0d117fcb03bf969

thanks

Original comment by martin.s...@gmail.com on 1 Dec 2011 at 2:05

GoogleCodeExporter commented 9 years ago
Awesome, thanks for doing this. Issue should be resolved now.

Original comment by bobaman@google.com on 2 Dec 2011 at 2:32

GoogleCodeExporter commented 9 years ago

Original comment by bobaman@google.com on 2 Dec 2011 at 2:32