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

fix: don't use integer for enums in json encoding #761

Merged
merged 3 commits into from
Feb 3, 2021

Conversation

yon-mg
Copy link
Contributor

@yon-mg yon-mg commented Feb 2, 2021

Integers for enums in json encoded requests is not desired.

@yon-mg yon-mg requested a review from a team as a code owner February 2, 2021 17:46
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 2, 2021
@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #761 (482f4ae) into master (aaabb27) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #761   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         1619      1619           
  Branches       328       328           
=========================================
  Hits          1619      1619           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaabb27...482f4ae. Read the comment docs.

Copy link
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integers for enums in json encoded requests is not desired.

Out of curiosity is there a doc somewhere stating this? Is it for human readability?

Copy link
Contributor

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

If there is already a unit test that checks the REST request sent out, it would be good to capture this there. But if there isn't, don't worry about it right now; we'll do it later.

@vchudnov-g
Copy link
Contributor

@busunkim96 Yes, the internal design docs specify this. Essentially, we can't guarantee that the numeric values will be preserved when converting from the Discovery file, so we use the string representations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants