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

Annotate Request Body messages as Required #18

Closed
bshaffer opened this issue Dec 29, 2020 · 1 comment
Closed

Annotate Request Body messages as Required #18

bshaffer opened this issue Dec 29, 2020 · 1 comment
Assignees

Comments

@bshaffer
Copy link
Contributor

bshaffer commented Dec 29, 2020

When a request message appears in a discovery doc, for example:

message InsertForwardingRuleRequest {
  "insert": {
      //...
      "request": {
          "@ref": "ForwardingRule"
      }
      //... 
  }
  //...
}

This generates a request message with that resource on it:

message InsertForwardingRuleRequest {
  ForwardingRule forwarding_rule_resource = 32776239;
  //...
}

However, the required annotation is missing in the proto. As a result, the call in GAPIC PHP looks like the following:

$optionalParams = ['forwardingRule' => $forwardingRule];
$forwardingRulesClient->insert('project', 'region', $optionalParams);

When it would be better as this:

$optionalParams = [];
$forwardingRulesClient->insert('project', 'region', $forwardingRules, $optionalParams);

We should verify with the API teams that any message in a request body is required.

@bshaffer
Copy link
Contributor Author

bshaffer commented Jan 6, 2021

Fixed in #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant