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

feat: Add support for rest numeric enums. #1020

Merged
merged 2 commits into from
Aug 23, 2022
Merged

Conversation

blakeli0
Copy link
Collaborator

@blakeli0 blakeli0 commented Jul 26, 2022

See b/232457244 for exact requirements. In short, this PR added four things:

  1. Add a flag to the Java microgenerator Bazel plugin to determine whether we need to generate a client library that supports rest numeric enums. This flag is to make sure we only generate client libraries with numeric enums for the services that have already upgraded to the latest ESF. See go/gapic-numericenum-release for details.
  2. Serialize enum object to int if the above flag is set to true
  3. Add a query parameter $alt=json;enum-encoding=int to every request if the above flag is set to true so that the backend will return response with numeric enums.
  4. Upgrade gax-java to the latest since it's dependent on feat: Add numeric enum support. gax-java#1743.

Add a flag to the Java microgenerator Bazel plugin to determine whether we need to generate a client library that supports rest numeric enums.
@sonarcloud
Copy link

sonarcloud bot commented Aug 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

93.9% 93.9% Coverage
0.0% 0.0% Duplication

@blakeli0 blakeli0 merged commit 0a89829 into main Aug 23, 2022
@blakeli0 blakeli0 deleted the add-numeric-enum-support branch August 23, 2022 20:28
suztomo pushed a commit that referenced this pull request Dec 16, 2022
See b/232457244 for exact requirements. In short, this PR added four things:

1. Add a flag to the Java microgenerator Bazel plugin to determine whether we need to generate a client library that supports rest numeric enums. This flag is to make sure we only generate client libraries with numeric enums for the services that have already upgraded to the latest ESF. See go/gapic-numericenum-release for details.
2. Serialize enum object to int if the above flag is set to true
3. Add a query parameter $alt=json;enum-encoding=int to every request if the above flag is set to true so that the backend will return response with numeric enums.
4. Upgrade gax-java to the latest
suztomo pushed a commit that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants