Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Support Json RPC 2.0 #5

Open
Tolriq opened this issue Feb 24, 2016 · 3 comments
Open

Support Json RPC 2.0 #5

Tolriq opened this issue Feb 24, 2016 · 3 comments

Comments

@Tolriq
Copy link

Tolriq commented Feb 24, 2016

Thanks for your library, great source for new comers to retrofit looking for Json RPC handling.

I'd like to add support for Json RPC 2.0 to your library, are you interested in such commits ?
(Mainly support for named parameters / notifications (no id) / add the jsonrpc field)

I've added support in my fork : Tolriq@ba9a6d1.

But I'm not satisfied with the code duplication and everything but since I do not yet master Retrofit and all the converters things I chose the easy way to be sure it can work :) (Sorry for the code formatting, I tends to forgot to disable it when I work on forks)

If you have some better idea or tips on how I should manage it more clean, please share and I'll update the code and make appropriate PR.

If you have idea on how you'll handle #1 / #2 that would need future change of all this, I can look at that too, but I'm currently retrofit noob ;)

@f2prateek
Copy link
Contributor

Thanks for offering to help! We've pushed back the project that needed to use this library so I think it's best if you used a fork for now - since we're not really working on this library for a while.

@Tolriq
Copy link
Author

Tolriq commented Feb 24, 2016

Ok no problem, any pointer or idea you had around #2 as it would be useful in my case too ?

@f2prateek
Copy link
Contributor

You could make the class public - and in the adapter factory just check if the requested class is of JSONRRPResponse/Request - if it is you can just return null and the default converter will kick in.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants