Skip to content

Conversation

@busunkim96
Copy link
Contributor

Some APIs mark every field in a oneof as "required" to express that the oneof itself is required.

https://github.com/googleapis/googleapis/blob/55726d62556966c095a096aed1ffda5da231f36d/google/cloud/channel/v1/service.proto#L1057-L1069

// Request message for [CloudChannelService.ImportCustomer][google.cloud.channel.v1.CloudChannelService.ImportCustomer]
message ImportCustomerRequest {
  // Specifies the identity of the transfer customer.
  // A customer's cloud_identity_id or domain is required to look up the
  // customer's Cloud Identity. For Team customers, only the cloud_identity_id
  // option is valid.
  oneof customer_identity {
    // Required. Customer domain.
    string domain = 2 [(google.api.field_behavior) = REQUIRED];

    // Required. Customer's Cloud Identity ID
    string cloud_identity_id = 3 [(google.api.field_behavior) = REQUIRED];
  }
...

This causes an error in the current logic since two requests are generated for the same field.

@busunkim96 busunkim96 requested review from a team as code owners November 17, 2021 02:25
@snippet-bot
Copy link

snippet-bot bot commented Nov 17, 2021

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 17, 2021
@busunkim96 busunkim96 added the automerge Merge the pull request once unit tests and other checks pass. label Nov 18, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 5531795 into master Nov 18, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the snippetgen-fix-oneof-fields branch November 18, 2021 18:40
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Nov 18, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Dec 8, 2021
🤖 I have created a release \*beep\* \*boop\*
---
## [0.58.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.57.0...v0.58.0) (2021-12-07)


### Features

* add support for long-running operations with rest transport. ([#1094](https://www.github.com/googleapis/gapic-generator-python/issues/1094)) ([e89fd23](https://www.github.com/googleapis/gapic-generator-python/commit/e89fd23609625c5aa49acd6c6ee67f87fce324fd))


### Bug Fixes

* ensure rest unit tests have complete coverage ([#1098](https://www.github.com/googleapis/gapic-generator-python/issues/1098)) ([0705d9c](https://www.github.com/googleapis/gapic-generator-python/commit/0705d9c5dbbea793867551e64991be37d8339c6b))
* fix resource path args for paths with =** ([#1089](https://www.github.com/googleapis/gapic-generator-python/issues/1089)) ([309cc66](https://www.github.com/googleapis/gapic-generator-python/commit/309cc66e880e07940866864b03c744310ef56762))
* **snippetgen:** don't create duplicate requests for required oneofs ([#1088](https://www.github.com/googleapis/gapic-generator-python/issues/1088)) ([5531795](https://www.github.com/googleapis/gapic-generator-python/commit/55317956397370a91b1a06ecd476e55f58789807))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants