Skip to content
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

MyBusinessQA Service has wrong paths #956

Closed
unbreak opened this issue Apr 27, 2022 · 4 comments
Closed

MyBusinessQA Service has wrong paths #956

unbreak opened this issue Apr 27, 2022 · 4 comments
Labels
type: question Request for information or clarification. Not an issue.

Comments

@unbreak
Copy link

unbreak commented Apr 27, 2022

In src/MyBusinessQA.php for locations_questions there are wrong paths for methods create and list, fot both should be:

'path' => 'v1/{+parent}/questions',

not:

'path' => 'v1/{+parent}',

Steps to reproduce

  1. try to call:
$qaService = new MyBusinessQA($client);
$questions = $qaService->locations_questions->listLocationsQuestions($locationName);
  1. You will get exception that read_mask is required field because its trying to get location not questions list for provided location.
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 28, 2022
@unbreak
Copy link
Author

unbreak commented May 9, 2022

Fixing by #1010

@bshaffer
Copy link
Contributor

bshaffer commented May 9, 2022

The discovery doc shows the path we have in the library here as the path for listing questions. There's nothing we can do here unless that changes. I would suggest contacting the API team if you think this is an error.

The maintainers of this repo only make sure the generated clients match the API's discovery doc, and do not support any specific API usage questions (there are over 200 APIs, so it would be impossible for us to do that)

@bshaffer bshaffer added the type: question Request for information or clarification. Not an issue. label May 9, 2022
@yoshi-automation yoshi-automation removed 🚨 This issue needs some love. triage me I really want to be triaged. labels May 9, 2022
@bshaffer
Copy link
Contributor

bshaffer commented May 9, 2022

I'm looking into the flatPath parameter in the discovery doc, as that seems to be closer to the URL you've provided

Update: The flatPath parameter is not used by any of our discovery API client library generators, so we think this may be a problem in the API's discovery doc.

@bshaffer
Copy link
Contributor

bshaffer commented May 9, 2022

So, looking at the discovery doc, the parent parameter should contain "/questions" in the path:

{
"list": {
    "parameters": {
        "parent": {
            "description": "Required. The name of the location to fetch questions for.",
            "location": "path",
            "required": true,
            "type": "string",
            "pattern": "^locations/[^/]+/questions$"
        },
    }
}

So the correct usage should be:

$qaService = new MyBusinessQA($client);
$questions = $qaService->locations_questions->listLocationsQuestions('locations/LOCATION_NAME/questions');

I agree this is not very intuitive, but I believe this is how the API is designed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants