0

Hey I'm building out a mobile app specific api and it would be of great help to my front end devs if the response case could be CamelCase instead of dashed.

I'm looking for a setting on AMS, as the documentation updates have been lagging.

versions
active_model_serializers (~> 0.10.0) using adapter json_api

current: { foo: { foos-bar: { id: "2" } }

looking for { Foo: { FoosBar: { "id": "2" } }

you get the idea, any thoughts?

ChrisCPO
  • 443
  • 2
  • 15
  • what have you tried to solve this yourself? Have you tried writing a json-builder of some sort? – Taryn East Feb 07 '17 at 23:34
  • Note: here at Stack Overflow, we always expect you to have a go at solving your problem yourself... then to show us what you've tried (even if it isn't working). This shows us that you've put in some kind of effort, and also lets us know better what you're trying to do and why. – Taryn East Feb 07 '17 at 23:45
  • @TarynEast No I have not, The documentation for active_model_serializer is a pretty common gem and it is getting updated pretty quick that the documentation is quite behind I had to dig through the issues to figure out how to serialize relationship models for the 0.10 version. I am simply wondering if anyone knows of a setting I do not know of. – ChrisCPO Feb 07 '17 at 23:45
  • @TarynEast well in that case you have a lot of admining to do. http://stackoverflow.com/questions/4820549/how-to-empty-db-in-heroku http://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git – ChrisCPO Feb 07 '17 at 23:47
  • :) 6 and 7 years ago, this rule wasn't strongly in place... – Taryn East Feb 07 '17 at 23:59
  • "I am simply wondering if anyone knows of a setting I do not know of." This should be part of your original question... it clarifies what you're looking for... ie that you aren't asking us to *write you a builder* which is what it sounds like as it currently stands ;) – Taryn East Feb 08 '17 at 00:21
  • 1
    ah @TarynEast my mistake. will rephrase. – ChrisCPO Feb 08 '17 at 17:58
  • This seems to indicate that there is a setting like that called `key_transform`: https://github.com/rails-api/active_model_serializers/issues/1891 Might be a thing to google for. – Taryn East Feb 08 '17 at 20:37

0 Answers0