cloudresourcemanager.project.getIamPolicy recently started throwing 'Missing required parameter "body"'
See original GitHub issueReplicated in version 1.7.7, 1.7.8, and 1.7.9 on MacOS, and various flavors of linux with python 3.7
Prior to July 3rd, the following code worked, and returned the IAM policy for a given project:
from googleapiclient.discovery import build
service = build('cloudresourcemanager','v1')
req = service.projects().getIamPolicy(resource='my-project')
resp = req.execute()
print(resp)
Since then, our existing applications using that functionality started throwing an error that the required parameter body
was missing. At first I thought google made a breaking change to the discovery document, but upon checking, the discovery doc does not require the body
parameter. Then I started poking around and I see this library adds it as required here: https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/discovery.py#L494
All of the code related to this, that I noticed, is over 7 years old. So its unlikely that a change to the library broke anything. One thing that COULD explain the issue is a few lines below the line i linked above… IF the discovery document didn’t previously send a request
field in the method description, this library would make the body optional. I have no way to determine if that actually happened, as I don’t have any older cached discovery documents for the cloudresourcemanager v1 API.
I realize what I’m reporting here isn’t a bug with this library, but something appears to have changed the behavior in this case (and potentially others) so I wanted to:
- report it (so others can find it)
- see if you have a way to determine what happened
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
Other folks were impacted by this change and reached out via the internal issue tracker.
After discussion with folks on the team, the recommendation was to pass an empty body and let the server do the validation. I will create a PR shortly.
@jceresini A PR would most definitely be appreciated!
My only concern is that “OPTIONAL” is marked inside the string for
description
. I’m not sure if this is the standard way (across APIs), or if this was done one-off for cloud resource manager. I’ll look into that and get back to you.