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

Raw paginated method samples always assume that paginated field is called responses #880

Closed
vam-google opened this issue Dec 15, 2021 · 0 comments · Fixed by #1001
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@vam-google
Copy link
Contributor

vam-google commented Dec 15, 2021

For each paginated method GAPIC clients also provide a raw version of it, without GAPIC pagination machinery enabled. The inline code samples for such methods always assume that there is a repeated field named "responses`, while the repeated field may be given any field (paginated response must have only one repeated field by convention, but that repeated field may have any name).

For example in vision/v1/ProductSearchClient.java#L675:

Instad of:

for (ProductSet element : response.getResponsesList()) {

It should be:

for (ProductSet element : response.getProductSetsList()) {

Because the corresponding paginated field in the proto definition is called product_sets

Currently the samples assume response.getResponsesList() for all gapics regardless of how the field is actually called in each specific API.

The same stuff but in gapic-generator-java goldens:
EchoClient.golden#L526
echo.proto#L237

Notice, in gapic-generator-java tests the paginated field is actually called responses, coincidentally leading to a correct result (hard-coded value matches actual value).

@vam-google vam-google added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 15, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Dec 15, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Mar 15, 2022
@blakeli0 blakeli0 assigned alicejli and unassigned blakeli0 May 26, 2022
suztomo pushed a commit that referenced this issue Mar 21, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.5](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.4...v3.0.5) (2022-10-20)


### Dependencies

* Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4.20221013 ([#868](https://togithub.com/googleapis/java-shared-dependencies/issues/868)) ([5c2a825](https://togithub.com/googleapis/java-shared-dependencies/commit/5c2a825c18af61784287dd41eba3a21be80bbe6b))
* Update dependency com.google.auth:google-auth-library-bom to v1.12.0 ([#870](https://togithub.com/googleapis/java-shared-dependencies/issues/870)) ([3e3a60d](https://togithub.com/googleapis/java-shared-dependencies/commit/3e3a60dfd45f08401ee3ac7a98007fae21d5bba6))
* Update dependency com.google.auth:google-auth-library-bom to v1.12.1 ([#871](https://togithub.com/googleapis/java-shared-dependencies/issues/871)) ([4d94c75](https://togithub.com/googleapis/java-shared-dependencies/commit/4d94c753b46d7f8c787b0efa21d7bc42b1ca1c6c))
* Update dependency com.google.cloud:grpc-gcp to v1.3.0 ([#867](https://togithub.com/googleapis/java-shared-dependencies/issues/867)) ([48ca222](https://togithub.com/googleapis/java-shared-dependencies/commit/48ca222a5e4d9f88737d4c4a4ee2a42a7145619e))
* Update dependency com.google.errorprone:error_prone_annotations to v2.16 ([#865](https://togithub.com/googleapis/java-shared-dependencies/issues/865)) ([d7a494d](https://togithub.com/googleapis/java-shared-dependencies/commit/d7a494dcd12a529121b74fd9fb9dfc679017f844))
* Update dependency com.google.protobuf:protobuf-bom to v3.21.8 ([#872](https://togithub.com/googleapis/java-shared-dependencies/issues/872)) ([ebe5d5f](https://togithub.com/googleapis/java-shared-dependencies/commit/ebe5d5f27dbe4f12c06d3a69c14c74bbf4e76dd1))
* Update dependency gcp-releasetool to v1.8.10 ([#853](https://togithub.com/googleapis/java-shared-dependencies/issues/853)) ([5c6367a](https://togithub.com/googleapis/java-shared-dependencies/commit/5c6367a643f491d2ec04be58c1ff0eca5aa10904))
* Update dependency google-api-core to v2.10.2 ([#858](https://togithub.com/googleapis/java-shared-dependencies/issues/858)) ([bc91e8d](https://togithub.com/googleapis/java-shared-dependencies/commit/bc91e8df54f9d919a9e0dc69e61d52fd855a8dbf))
* Update dependency io.grpc:grpc-bom to v1.50.0 ([#866](https://togithub.com/googleapis/java-shared-dependencies/issues/866)) ([50039f4](https://togithub.com/googleapis/java-shared-dependencies/commit/50039f41bfba37e65685c4a5b279d3cb2a92f2c5))
* Update dependency io.grpc:grpc-bom to v1.50.1 ([#873](https://togithub.com/googleapis/java-shared-dependencies/issues/873)) ([9fb1561](https://togithub.com/googleapis/java-shared-dependencies/commit/9fb15613976f83c5545e2b664c488e9811c1f185))
* Update dependency org.checkerframework:checker-qual to v3.26.0 ([#852](https://togithub.com/googleapis/java-shared-dependencies/issues/852)) ([1e8cd60](https://togithub.com/googleapis/java-shared-dependencies/commit/1e8cd609b3be0cdd748a8fea6bc0fcb15d8f4c96))
* Update dependency org.threeten:threetenbp to v1.6.3 ([#869](https://togithub.com/googleapis/java-shared-dependencies/issues/869)) ([e992190](https://togithub.com/googleapis/java-shared-dependencies/commit/e9921900ec590e281b5ae6e16ab51e7bd67c1242))
* Update dependency typing-extensions to v4.4.0 ([#854](https://togithub.com/googleapis/java-shared-dependencies/issues/854)) ([c909a13](https://togithub.com/googleapis/java-shared-dependencies/commit/c909a13fa626eb387c8ee87b7cc22607cb9cf889))
* Update dependency zipp to v3.9.0 ([#859](https://togithub.com/googleapis/java-shared-dependencies/issues/859)) ([971b84e](https://togithub.com/googleapis/java-shared-dependencies/commit/971b84eb801699b585cd35300bed8d4fb65046d8))
* Update gax.version to v2.19.4 ([#875](https://togithub.com/googleapis/java-shared-dependencies/issues/875)) ([2eb7f3d](https://togithub.com/googleapis/java-shared-dependencies/commit/2eb7f3d6cf834c474dcdc99740f8cdabf50bca51))
* Update google.core.version to v2.8.21 ([#861](https://togithub.com/googleapis/java-shared-dependencies/issues/861)) ([2fda421](https://togithub.com/googleapis/java-shared-dependencies/commit/2fda4213796df086450fdc3d69d53a0bd1d59f46))
* Update google.core.version to v2.8.22 ([#879](https://togithub.com/googleapis/java-shared-dependencies/issues/879)) ([e4f9f9a](https://togithub.com/googleapis/java-shared-dependencies/commit/e4f9f9ad6373fb52c069985ca4390663ccdacb7d))
* Update iam.version to v1.6.3 ([#857](https://togithub.com/googleapis/java-shared-dependencies/issues/857)) ([6758373](https://togithub.com/googleapis/java-shared-dependencies/commit/675837378642f39fe55c0e30b62755b9185bee3d))
* Update iam.version to v1.6.4 ([#862](https://togithub.com/googleapis/java-shared-dependencies/issues/862)) ([1e1bc34](https://togithub.com/googleapis/java-shared-dependencies/commit/1e1bc341c9dd0f8f5a2d14aa8dd52399b2ce71c1))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
suztomo pushed a commit that referenced this issue Mar 21, 2023
🤖 I have created a release *beep* *boop*
---


## [2.8.4](googleapis/java-core@v2.8.3...v2.8.4) (2022-07-27)


### Documentation

* update javadocs for ReadChannel#limit to be more clear ([#880](googleapis/java-core#880)) ([942e8cc](googleapis/java-core@942e8cc))


### Dependencies

* Update google-cloud-shared-config to v1.5.3 ([#882](googleapis/java-core#882)) ([5997769](googleapis/java-core@5997769))

---
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
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants