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

Switch out some snake_to_camel usage for a keymap #72

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

stevelacey
Copy link
Contributor

@stevelacey stevelacey commented Nov 9, 2021

What's this PR do?

Switch out snake_to_camel usage where we're attempting to recreate the name of the field the client supplied, because we know the name they supplied, and it might not be what snake_to_camel produces.

Also drops whitespace_to_camel which seems to do the same thing as snake_to_camel(thing.replace(" ", "_").lower()) and I'd rather maintain fewer casing helpers.

Where should the reviewer start?

Bundle processing.

Why is this important, or what issue does this solve?

In a world where we accept complex lookups via filter params with __ in them we can't reliably camelize snake case and get the right thing out.

Also, we technically support snake case, and without this change our errors will describe the fields back to the client in camel case, regardless of what they passed, which is confusing.

Tasks

  • This PR increases test coverage
  • This PR includes README updates reflecting any new features/improvements to the framework

@stevelacey stevelacey force-pushed the improvement/reduce-snake-to-camel-usage branch from 07b2e7d to 4bfcd5b Compare November 9, 2021 09:27
@stevelacey stevelacey force-pushed the improvement/reduce-snake-to-camel-usage branch from 4bfcd5b to a36c9ba Compare November 9, 2021 09:27
@stevelacey stevelacey changed the title Reduce snake to camel usage Switch out some snake_to_camel usage for a keymap Nov 9, 2021
@wadewilliams wadewilliams merged commit c1a3337 into master Nov 15, 2021
@wadewilliams wadewilliams deleted the improvement/reduce-snake-to-camel-usage branch November 15, 2021 18:03
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.

2 participants