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

Generator should skip generation for empty services #2750

Open
alicejli opened this issue May 7, 2024 · 2 comments
Open

Generator should skip generation for empty services #2750

alicejli opened this issue May 7, 2024 · 2 comments
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

@alicejli
Copy link
Contributor

alicejli commented May 7, 2024

A scenario came up with googleapis/google-cloud-java#10802 where https://github.com/googleapis/googleapis/blob/master/google/cloud/visionai/v1/prediction.proto contains an empty service (e.g. no RPCs).

There tests fail when trying to compile the generated library containing this proto which means the generator is generating some classes for this empty service which are not compilable. The generator instead should skip generation for an empty service.

@alicejli alicejli added 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. labels May 7, 2024
@blakeli0
Copy link
Collaborator

Similar issue #2050 where the gapic generator errors out if no service exists.

@blakeli0
Copy link
Collaborator

blakeli0 commented May 28, 2024

Possible solutions:

  1. Skip generation clients if no RPCs found for a service.
  2. Generate an empty client, no ideal but maybe there is a use case for empty clients.

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