Open wujibear opened 1 year ago
I left some feedback in the attached PR. This makes sense to me. Although, I wonder if it would be worth providing some out-of-the-box options too. Since I'm guessing 95% of the use cases for this would be camel case, pascal case or kebab case.
I had thought of just taking a symbol for :snakecase
, :camelcase
, etc. but then I wasn't sure it would be evaluated within rails itself rather than ruby.
I figured a lambda/proc would be more explicit and avoid potential issues with it not having string translation methods.
@adamcrown I've updated the PR with specs like you asked, did you have any other input for me on what you'd like to see?
I'm thinking this hasn't been made yet, but is there already (or would you be open to) a way to camelize serialized attribute keys?
For my own API, I want to refer to attributes in snakecase but would rather show those attributes in camelcase when sending to the client.