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

Translate "uncased" keys in response bodies to snake case #13

Closed
gsterndale opened this issue Oct 24, 2013 · 1 comment
Closed

Translate "uncased" keys in response bodies to snake case #13

gsterndale opened this issue Oct 24, 2013 · 1 comment
Assignees
Milestone

Comments

@gsterndale
Copy link
Contributor

This should probably be a configuration option.

@nicholaides
Copy link
Contributor

I can think of 2 approaches for this:

  1. Simply convert all keys to snake case. For example, if you were to print out a response, you would see: disk_bytes_read_rate instead of diskBytesReadRate and cloud_identifier instead of cloudidentifer. This would be the ideal, in my mind.

The challenge is that there are ~475 keys that we would need to get right (https://gist.github.com/nicholaides/7185973). It doesn't seem feasible or robust to maintain a list of translations or even a list of rules that would help us translate.

  1. Another option would be to make the response objects have "indifferent access", as we did with requests. For example, if you try to access the key disk_bytets_read_rate or diskbytesreadrate, it would give you the key diskBytesReadRate.

Given the challenging nature of option 1, I think option 2 is best.

@ghost ghost assigned gsterndale Oct 29, 2013
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

No branches or pull requests

2 participants