Support both an existing AMS API and the new JSON-API adapter in same app?

81 views
Skip to first unread message

Gary Gordon

unread,
Oct 29, 2014, 3:08:52 PM10/29/14
to rails-a...@googlegroups.com
Hello,

I'm planning to use the json-api adapter for version 3 of my app's API.  
I currently use active_model_serializers(0.8.2) for version 2. I need 
for both versions to be available together for some time to facilitate 
migration for my users.

I thought I could use the 'json' adapter for v2 and 'json-api' adapter
for v3, but the adapter seems to be global for the entire app not 
configurable per controller. Even if it were, many features have been 
removed in the 0.10 branch of AMS which would require drastic changes to
get my v2 API to work. Since I don't want to risk changing the behavior 
of v2, I really want to minimize the changes I need to make there.

Does anyone have any suggestions on how to have a legacy AMS API coexist
with the new AMS JSON-API adapter API?

regards,
Gary

Steve Klabnik

unread,
Oct 29, 2014, 3:49:12 PM10/29/14
to Gary Gordon, rails-a...@googlegroups.com
0.10 is a work in progress. It introduces the concept of 'adapters,'
which haven't existed before.

You can't really choose styles in 0.8, but in 0.10, you will be able
to. It's just not ready to use yet.

Gary Gordon

unread,
Oct 30, 2014, 9:55:28 AM10/30/14
to rails-a...@googlegroups.com, gfgo...@gmail.com
Thanks for the reply. Is it the goal that the 0.10.x with the 'json' adapter will be compatible (maybe some minor diffs) with existing serializers written with 0.8.2? If so, i'll make some PRs to help get it there.   

João Moura

unread,
Oct 30, 2014, 10:18:00 AM10/30/14
to Gary Gordon, rails-a...@googlegroups.com, gfgo...@gmail.com
Hey Gary,

Yeah, it will be based on 0.8.2 version and most of it syntax will remain similar, but there will definitively have some diffs.
We haven’t changed too much of it yet but there is some things that still have to be implemented, so you should keep track of it. :)


João M. D. Moura


--
You received this message because you are subscribed to the Google Groups "rails-api-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rails-api-cor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages