-
Notifications
You must be signed in to change notification settings - Fork 33
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
[SUGGEST] Please make support for Retrofit library by making this as jackson-jr Retrofit converter #30
Comments
Thank you for contributing this! I assume this is Retrofit: https://github.com/square/retrofit I wonder what would be the best way to share this. I guess one possibility would be to add a new Maven sub-module, to produce different jar? |
@GulajavaMinistudio quick question: it looks like Retrofit 2: http://square.github.io/retrofit/ already includes converters (see section CONVERTERS) for a few other libraries. Do you think that might be a better home for this extension? I can point Retrofit developers to this issue, to see if they would like to include it, with proper attribution (since you wrote it, give you the credit etc). |
@cowtowncoder : Yup, that's correct, there is for Retrofit 2. One of networking librray for Android and Java. We make those sample of Jackson-jr converter because some people asking it how to use with converter. And maybe someone can testing jackson-jr converter or maybe improved it (if there's error or fix, althought we have use those jackson jr for days) Maybe, it's better a some wiki or home for this converter, coz many android apps use retrofit for networking library. |
@GulajavaMinistudio I think it's a good idea to just provide this as a small library. I reached Retrofit authors, and it sounded like they might prefer not including this (although they do include couple ones already). So when I get a chance, I could just create a new sub-project (that is, sub-maven project) for this project here, and then library can be used via Maven. |
Alright then, is up to you if you want make it as library or extension. hope this is helpful for someone that needed it. |
Here the fixed version. We also included for parsing JSON if there is JSON Array form . For Converter.Factory class For JacksonJrResponseConverter class For JacksonJrResponseArrayConverter class For JacksonJrRequestBodyConverter For complete project : Hope it will help |
@GulajavaMinistudio I finally had time to get this in. I made minor changes, mostly to allow passing specifically configured Thank you once again for this contribution! |
I make custom converter factory for Jackson-jr parser.
Jackson-jr itself is good for mobile devices due to resource requirements during startup and usage is quite low.
https://github.com/FasterXML/jackson-jr
And after a long experiment, Converter Factory for Jackson-jr was successfully run.
I use generic class or object T that needed for Jackson-jr for JSON Parsing.
Here's the snippet
Or you can look it in here :
https://gist.github.com/GulajavaMinistudio/67959246f6d94e373d4c
And for Rest Client instance :
Or you can see it here
https://gist.github.com/GulajavaMinistudio/b853e01ee2ef4fb2213a
If you want to testing, i have made sample project for how to usage it :
https://github.com/GulajavaMinistudio/BelajarRetrofitJacksonJr
Hope it can help for someone that need Jackson-jr converter in Retrofit 2.
The text was updated successfully, but these errors were encountered: