active_model_serializers icon indicating copy to clipboard operation
active_model_serializers copied to clipboard

Custom Adapter documentation

Open eebasadre opened this issue 8 years ago • 1 comments

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!

eebasadre avatar Feb 21 '17 07:02 eebasadre

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.

bf4 avatar Feb 28 '17 04:02 bf4