Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 0.9.x and 0.10.x in same project #1136

Closed
yoda opened this issue Sep 11, 2015 · 6 comments
Closed

Using 0.9.x and 0.10.x in same project #1136

yoda opened this issue Sep 11, 2015 · 6 comments

Comments

@yoda
Copy link

yoda commented Sep 11, 2015

Hi All,

I am working on a largish rails codebase which uses 0.9.x for all the json serialisation. I want to start using the jsonapi style adapter either along side or as a engine or something so that I do not have to change all the 0.9.x code directly to 0.10.x. However I am at a loss as to how to get them to play nice together. As I have heaps of legacy stuff dependent on 0.9.x and want to slowly move stuff over to 0.10.x is there any way to be able to do this without having to do it all at once.

I saw a question/issue similar to this a while ago however I have not been able to find it again.

Also, thank you all for your great work.

@beauby
Copy link
Contributor

beauby commented Sep 12, 2015

Good question. If somebody comes up with a satisfying answer to this one, I think it is worth putting in the docs.

@NullVoxPopuli
Copy link
Contributor

I don't know if this is possible due to how bundler works. (unless there is something I don't know about -- which is likely)

What functionality are you wanting that is different between the two versions?

With 0.10 RC3 and forward, you'll be able to specify adapters manually in your controllers - so that would help with the json api using

@yoda
Copy link
Author

yoda commented Sep 14, 2015

Well our current "api" is a mess and using 0.9.x (it works but its not standardised etc). In 0.9.x we are using the default serialisation mode that it supports (with heavily customised serialisers). Whereas with the 0.10.x I wanted to use the json_api mode one. So ideally it would be that I could somehow use the 0.9.x style for some and then the json_api style for others. If I need to do this as a case by case basis it would be best if it was in the way that the old code could stay untouched and I could add the json_api stuff specifically as I add / convert new stuff. Obviously this is the nice case but if its not possible than I guess the opposite would be ok too (specifying on old, defaulting on new).

@joaomdmoura
Copy link
Member

@NullVoxPopuli On RC2 you can already specify adapter manually in controller I think.
@yoda I've done something similar in order to keep different versions of JSON-API on the same application. There are a lot of way of making this work but two specially that looks nicer.

  • If there are no specific 0.9 features involved basically you would want to use multiple adapter, and in order to do this you can use the accept HTTP header with the specified media type on JSON API. You can do it by youself but there is also a PR opened that would implement this on the AMS
  • If it something more dependent on something of 0.9, some specific serialization format for example, then the easiest way would be to write an adapter that would implement this specific behavior.

But right now you could use the first option already on RC2 😁

@yoda
Copy link
Author

yoda commented Sep 14, 2015

Ah ok I'll give those a go. Thanks.

@yoda
Copy link
Author

yoda commented Sep 15, 2015

This is related to #1005

@joaomdmoura joaomdmoura self-assigned this Sep 15, 2015
@remear remear closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants