skyscreamer / yoga

Yoga is RESTful but flexible.
http://yoga.skyscreamer.org/
Apache License 2.0
157 stars 66 forks source link

Support for Jackson 2 #233

Closed nikosk closed 10 years ago

nikosk commented 10 years ago

Hello, I was scratching an itch and I thought you might want to use this code.

I have a project that uses Jackson 2.x for json serialization and I wanted to use yoga without having to import Jackson 1.x dependencies. This PR makes Jackson an optional dependency and the user can choose which version to use by including the dependency in his/her project. As long as either Jackson 1.x or 2.x is in the classpath yoga works as expected.

carterpage commented 10 years ago

Interesting. We'll have to schedule this with a minor release, not a patch release since it will change the behavior for users.

carterpage commented 10 years ago

Sorry for the delay. We'll look at this this week.

nikosk commented 10 years ago

No worries. Let me know if you have any comments/recommendations.

kentongray commented 10 years ago

please disregard that reference, I was under that resteasy was needing jackson 2.0 but misread (too many Js)

Siluetti commented 10 years ago

Hello,

This feature has been sitting here for over 8 months now and I'm wondering if it's going to end up in Yoga or not?

I and my company would really much enjoy using Yoga for our projects as it's basic premise is great, but currently it really looks like that it's not under active development and that the core team is blocking the development of the project. I understand that we all get busy every now and then, but I have really hard time to convince myself to use a product that has had pull requests waiting this long and has had last commit made 3 months ago (even though feature request list has 18 items).

I know I come off sounding harsh as this is after all open source project. But it's open source project where it seems the main characters are sitting on top of the code while there are community members making suggestions and code enhancements. I really like your project (and this is where my anxiety comes from) and I really would like to see it fly, but currently it doesn't serve my needs and it seems that all the pieces that would be needed to fix my problems are already there, they are just not part of the puzzle yet. I don't want to fork the code to build the framework for my own needs as it defies the purpose of having the framework in the first place.

If there's something I value more than (framework) speed and good architecture, it's that the tool I use gets things done and if not I (or the community) can make something to fix it quickly. Currently Yoga seems to emphasis both first and second, but not the third and fourth. And unfortunately that's all the reason I need not to use Yoga, but instead go on using the stone age methods and writing the boilerplate code by myself.

Still, I hope to see this project succeed, as (even at this point) it's light-years ahead from anything else I've seen accomplished regarding partial response (code-wisely). It's a shame not to use it. But it would be greater shame to revert back to old tools (such as Jackson 1.x) and hack all the individual components for my purposes (see #221 ), so the choice is easy.

That said I would like to hear what kind of plans the core group has for this project in the future. Is it going to stay as stale as it is or will there be stronger effort to make it better?

Best regards, Jukka Hämäläinen

cepage commented 10 years ago

Thanks for the feedback, Jukka. Jackson 2 support is obviously important for the project to be viable, so I will get off my ass and take a look at it this weekend.

Siluetti commented 10 years ago

Just returned from vacation to find my new favorite library has been updated. :) This makes things so much simpler! Thank you so much!

cepage commented 10 years ago

Glad we could help. Big thanks to @nikosk for getting this jumpstarted.

As of version 1.0.6, Yoga will search for Jackson2, and use it if found. If not, it will search for Jackson1.

This behavior can be overridden with the system property "yoga.jackson-library". This property can be set to "jackson2" or "jackson" to force usage of a specific version.