Closed jaslong closed 5 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here (e.g. I signed it!
) and we'll verify it.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
rejoiner/src/main/java/com/google/api/graphql/rejoiner/GqlInputConverter.java | 9 | 11 | 81.82% | ||
<!-- | Total: | 9 | 11 | 81.82% | --> |
Totals | |
---|---|
Change from base Build 94: | 0.04% |
Covered Lines: | 809 |
Relevant Lines: | 1933 |
I signed it!
CLAs look good, thanks!
Pinging @siderakis -- can I get a review on this please?
Hey, thanks for the PR, overall looks good! Only question is, why require all fields to be consumed?
I assumed that there is a validation step before this that ensures the correct shape of types. This means that we should always consume all fields. Do you think this is a fair assumption to make? Having this assertion prevents similar bugs in the future.
On Fri, Sep 28, 2018 at 6:06 AM Nick Siderakis notifications@github.com wrote:
Hey, thanks for the PR, overall looks good! Only question is, why require all fields to be consumed?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/rejoiner/pull/53#issuecomment-425429676, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwqpEFiCk80hU5MjXefQVjvW_Opeujkks5ufh7rgaJpZM4W5jcU .
It seems like a reasonable assumption. If input type modifications are added later we can revisit if needed.
Thanks again!
Bug was introduced in 6a9323c0c5a9c84e59fcf95f5df16c3e74c2469a. This commit aimed to convert underscore_case field names to camelCase. While the GraphQLInputObjectField's name was converted, GqlInputConverter#createProtoBuf(), which converts Map<String, Object> to a protobuf Message, did not do the same conversion. This resulted in fields like "id" working, but fields like "user_id" being ignored.
This change fixes the bug and adds an assertion that all input fields were consumed.