Jackson2 and Jackson1 support#59
Conversation
|
By the way, I signed the contributor's agreement this morning and can provide you the confirmation number |
|
Ok. It looks like spring-hateoas had to write separate abstract classes for jackson1 and jackson2, each one creating its own objectmapper. |
|
Great, thanks. Do you think we should make one of the Jackson dependencies non-optional (otherwise it won't work out of the box)? Any other ideas? I'll wait and see if @Hons (or anyone else) can come up with a less invasive strategy (externalizing the config), but given that Spring HATEOAS hasn't gone that route I'm inclined to believe it can't be done. If not I see that as a weakness of Jackson, although to be fair it's really a weakness of Java annotations. |
|
I don't know. It looks like spring-framework made the choice to declare both dependencies as optional. |
|
It's different for Spring because Jackson is clearly not a mandatory dependency. For OAuth it is for anyone who expects to get JSON output from the endpoints. Actually that's he same for HATEOAS and they have chosen to make both optional, so I'll try and find out why. I think I prefer to leave Jackson 1.9 as non-optional (at least for 1.0.1) otherwise users that don't happen to care will break their apps when they upgrade. |
|
We decided to have both dependencies optional for three reasons:
|
|
Thanks @olivergierke for the clarification. I think OAuth might be a bit different because while we do support XML rendering it is not required by the spec, whereas JSON is. My inclination therefore is to leave Jackson 1.9 as a default (no optional) dependency, which it is already in OAuth 1.0.0, therefore requiring users to explicitly exclude it if they want to use Jackson 2.0 (or only XML). |
|
👍 |
1 similar comment
|
👍 |
|
OK, thanks for the help with this. I squashed your commits, so discard your branch and reset to master. |
Like discussed in PR #58 - we can also add support for both Jackson1 and Jackson2 (like spring-hateoas).
This PR is far from perfect (I'm very happy about code duplication and adding annotations, but the package name change in Jackson made me do it!).
Should I copy/paste tests Jackson1 tests for Jackson2 ? Or do you have another testing strategy in mind?