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

Pagination support must not be generated unless all conditions are met #1017

Closed
noahdietz opened this issue Jul 18, 2022 · 1 comment
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@noahdietz
Copy link
Contributor

Based on the contents of https://google.aip.dev/client-libraries/4233, pagination support should only be added to a GAPIC method iff the following criteria are met:

Pagination can be inferred for an RPC when all of the following conditions are met:

* The request message contains an int32 page_size field.
* The request message contains a string page_token field.
* The response message contains a string next_page_token field.
* The response message contains one non-primitive repeated field.

Based on a recent report referencing http://cl/460633538, the Java generator is attempting to generate Pagination support even when the final item on that list is not fulfilled The response message contains one non-primitive repeated field. The response message in question FetchInventoryResponse does not have a repeated field, and even though it has the other pagination support fields.

@noahdietz noahdietz 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 Jul 18, 2022
@blakeli0
Copy link
Collaborator

This is done on purpose due to backwards compatibility reasons, due to this sentence in https://google.aip.dev/client-libraries/4233

Client libraries that are implementing automatic pagination must still provide access to the individual fields on the response message, in the usual fashion.

Also, I don't think this is in violation of the AIP since it says "Pagination can be inferred for an RPC when all of the following conditions are met", not something like "Pagination must not be inferred for an RPC when any of the following conditions are not met".

@blakeli0 blakeli0 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
suztomo pushed a commit that referenced this issue Mar 21, 2023
…1017)

* chore(java): update gcp-releasetool and cryptography in java requirements file
Source-Link: https://github.com/googleapis/synthtool/commit/74d0956884c1bb9dc901b52de35ca2bca025a74e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:142286d973c7b6d58186070f203b50058a20a7d7b42147996db24921a18da1b0
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. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants