active_model_serializers
active_model_serializers copied to clipboard
Custom Adapter documentation
Currently, we're using jbuilder in our existing app and now I'm thinking to move it to AMS but we've different structure of JSON, so I can't used the existing adapter. How can I able to build my own adapter? is there any documentation for this?
example:
{ "success": 200, "data": { "user": { "id": 12345678, "email": "[email protected]", "username": "batman", "password": "blahblahblah", . . . . . . . . . . } } }
By the way, I'm thinking to create a subclass of the ActiveModelSerializers::Adapter::Base to build my own adapter but I have this confusion that maybe I missed the correct way to create my own adapter.
Thanks!
I'd expect to make a subclass.
Duplicate of https://github.com/rails-api/active_model_serializers/issues/2058#issuecomment-281232098 Obviously docs need to be improved here.