nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

Add option to camelize keys #652

Closed rstrand closed 7 years ago

rstrand commented 8 years ago

I have added a configuration option camelize_keys which camel cases attribute keys. This should fix #469.

I added some new tests which pass, but the existing tests don't seem to be passing. I don't think my changes break anything thought.

apuntovanini commented 7 years ago

@nesquena any plans to merge this?

nesquena commented 7 years ago

Thanks for the reminder. Merged now.

apuntovanini commented 7 years ago

Great! Thank you! Would you release a new version or suggest to use #master instead? I love rabl, we use it extensively, let me know if there's anything we can do

nesquena commented 7 years ago

I'll release a new version soon. Glad to hear that you find RABL useful, I built it many years ago now. I don't have the time to maintain it much anymore unfortunately. Always looking for / appreciate new contributors :)

apuntovanini commented 7 years ago

I guess there are no good alternatives out there, or do you know any? I'll look through the issues and check if I find something I can work on

badosu commented 7 years ago

This would be relevant for us as well, currently using reference to master.

Let me know how I can help proceeding with this.

apuntovanini commented 7 years ago

@rstrand I don't know if it's related to your PR or not, but there's an issue regarding camelize_props. It does camelize all props but not the nested ones...what do you think? I could work on a PR @nesquena tomorrow

rstrand commented 7 years ago

@apuntovanini It's quite possible. It's been a while since I wrote the PR and I've mostly moved away from using RABL.

apuntovanini commented 7 years ago

@rstrand ok, I’ll check it out! Just out of curiosity, what do you use instead?

rstrand commented 7 years ago

@apuntovanini I've been using ActiveModelSerializers using the key transform option (https://github.com/rails-api/active_model_serializers/blob/0-10-stable/docs/general/configuration_options.md).

JSONAPI-RB also looks good if your JSON schema is flexible http://jsonapi-rb.org/

apuntovanini commented 7 years ago

@rstrand thank you very much for the suggestions, I'll check them out I added some failing tests, but I still cannot grasp how to fix the nested uncamelized props.. Any ideas @nesquena?