Skip to content

Conversation

@plaurina
Copy link
Contributor

Added a search in FieldResolverScanner for getters where the field name needs to be converted from snake to camel case.

Resolves #383

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

The findResolverMethod function has a cascading if/else check to try to find a matching method in a variety of formats. I added a 5th check (similar to the 3rd check) but instead of only capitalizing the fieldname I converted the fieldname from snake case to camelCase. The existing code uses Apache Commons-lang3 already, so I stayed with it to do the snake to camel case conversion. Ideally I would have preferred to use CaseFormat from Guava or CaseUtils from Apache Commons Text, but I did not want to introduce a new dependency.

plaurina and others added 2 commits December 20, 2020 14:37
… getters where the field name needs to be converted from snake to camel case.
@plaurina
Copy link
Contributor Author

plaurina commented Jan 8, 2021

@oliemansm Would love to get a review for this and have it in the next build if possible. Feedback is welcome of course.

Copy link
Collaborator

@oryan-block oryan-block left a comment

Choose a reason for hiding this comment

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

LGTM 👍
I replaced the apache utils calls with standard kotlin string manipulation.

@vojtapol vojtapol merged commit ebebf2c into graphql-java-kickstart:master Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants