GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Generator should skip generation for empty services · Issue #2750 · googleapis/sdk-platform-java

This repository was archived by the owner on Oct 29, 2026. It is now read-only.
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Generator should skip generation for empty services #2750

Copy link
Copy link
Closed
#3051
Closed
Generator should skip generation for empty services#2750
#3051
Copy link
Assignees
zhumin8
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@alicejli
alicejli
opened on May 7, 2024
Issue body actions

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.

Activity

  1. alicejli
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on May 7, 2024
  2. blakeli0 commented on May 28, 2024

    @blakeli0
    blakeli0
    on May 28, 2024
    Contributor
    More actions

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

  3. blakeli0 commented on May 28, 2024

    @blakeli0
    blakeli0
    on May 28, 2024
    Contributor
    More actions

    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.
  4. zhumin8
    self-assigned this
    on Jun 5, 2024
  5. zhumin8 commented on Jul 16, 2024

    @zhumin8
    zhumin8
    on Jul 16, 2024
    Contributor
    More actions

    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.

    Currently I am opting for option 1 in #3051, to skip generation altogether if no RPCs found in a service (filter in parsing services). However, I run into a conflict with this test, and discovered this relative old pr that put on a check for empty services for sample composers.

    • The above pr only fixes for sample code composers, thus we are still observing this behavior as reported in this issue.
    • The behavior in above pr still generates samples for empty services, while discussion on the pr seams to suggest it was a quick fix to not error out and author and reviewers seems to have consensus that services without RPCs should not be a thing.
    • this was originally a fix to enable sqladmin API, but I don’t see sql admin generated in google-cloud-java. Any context?

    I want to run this quickly by @blakeli0 to check if you think it's okay to not generate clients for empty services that do not have RPCs? Or otherwise, is empty services like this one a legit use case?

  6. blakeli0 commented on Jul 16, 2024

    @blakeli0
    blakeli0
    on Jul 16, 2024
    Contributor
    More actions

    Thanks for the investigation @zhumin8 ! I don't think this is a legit use case, the PR was probably trying to resolve a presubmit check internally when this proto was introduced.
    Since the specific service never request generation for a Java library, means there would be no breaking change once this issue is fixed, I think we are safe to not generating clients for empty services.

    Reacted by Min Zhu
  7. zhumin8
    closed this as completedin #3051on Jul 23, 2024
  8. zhumin8
    added a commit that references this issue on Jul 23, 2024

    fix: Generator to skip generation for empty services. (#3051)

    This issue will close once commit ff2c485 is merged into the 'main' branch.
    ff2c485
  9. chingor13
    added a commit that references this issue on Mar 24, 2026

    fix: Generator to skip generation for empty services. (#3051)

    This issue will close once commit 1af3059 is merged into the 'main' branch.
    1af3059
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @zhumin8
    zhumin8

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.