Hi Andrei On 15/03/14 11:24, Andrei Shakirin wrote:
Hi Sergei,That confused me a bit as well: my expectation is that "wrapperName" will have effect without "supportUnwrapped" (supportUnwrapped="false"), when JSON message comes without root element - but it is not the case. Do you think it make sense to rethinking current behaviour?
It is possible to optimize, but I'm not sure we will get much out of it.Note if 'supportUnwrapped' is set but 'wrapperName' is not then the runtime will try to figure out the actual wrappername itself. I agree if we set 'wrapperName' then we kind of assert that we want the rootless sequence wrapped, so having to set 'supportUnwrapped' is just one extra step. But having supportUnwrapped set to false and actually support wrapping would seem a bit inconsistent to me, given that 'supportUnwrapped' actually makes a difference in other cases without 'wrapperName' being set
So I'd just keep things as is :-) Cheers, Sergey
Regards, Andrei.-----Original Message----- From: Sergey Beryozkin [mailto:[email protected]] Sent: Freitag, 14. März 2014 12:36 To: [email protected] Subject: Re: How do get repository Well, JSONProvider needs to know if the sequence is root-less or not, Jettison does not do this kind of analysis. So "supportUnwrapped" (not the best property name I admit) is the indicator. It is redundant really when 'wrapperName' property is also used, which the only minor optimization that might be done in principle, it is not a big deal IMHO. As I said Jackson may be able to deal with it with fewer configuration options Sergey On 14/03/14 10:49, Manula Thantriwatte wrote:Yes, this is working. But is there a way to get repository details without the supportUnwrapped configuration. On Fri, Mar 14, 2014 at 3:22 PM, Sergey Beryozkin<[email protected]>wrote:Hi On 14/03/14 07:41, Manula Thantriwatte wrote:Hi All, I have the following JSON request. I want to get the repository details from it. I tried in several ways. But I'm unable to do that. Can anyone help me on this. I want to do this without adding following configurations. With this following configuration it works. <jaxrs:providers> <bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> <property name="dropRootElement" value="true"/> <property name="dropCollectionWrapperElement" value="true"/> <property name="serializeAsArray" value="true"/> <property name="supportUnwrapped" value="true"/> </bean></jaxrs:providers>I don't quite understand the question. I think the first 3 properties are affecting the serialization only, but the question is about reading. But either way, you have it working, right ? Cheers, SergeyThanks ! { "ref": "refs/heads/master", "after": "9066ef0aea8d73747bea322d03778ed880ba9ddb", "before": "a6abbdeaf4b7b29b646501583d408f16a033a975", "created": false, "deleted": false, "forced": false, "compare": "https://github.com/manulachathurika/stratos2- test/compare/a6abbdeaf4b7...9066ef0aea8d", "commits": [ { "id": "9066ef0aea8d73747bea322d03778ed880ba9ddb", "distinct": true, "message": "Test", "timestamp": "2014-03-12T19:19:30+05:30", "url": "https://github.com/manulachathurika/stratos2-test/commit/ 9066ef0aea8d73747bea322d03778ed880ba9ddb", "author": { "name": "Manula Thantriwatte", "email": "[email protected]", "username": "manulachathurika" }, "committer": { "name": "Manula Thantriwatte", "email": "[email protected]", "username": "manulachathurika" }, "added": [ ], "removed": [ ], "modified": [ "www/sleep.php" ] } ], "head_commit": { "id": "9066ef0aea8d73747bea322d03778ed880ba9ddb", "distinct": true, "message": "Test", "timestamp": "2014-03-12T19:19:30+05:30", "url": "https://github.com/manulachathurika/stratos2-test/commit/ 9066ef0aea8d73747bea322d03778ed880ba9ddb", "author": { "name": "Manula Thantriwatte", "email": "[email protected]", "username": "manulachathurika" }, "committer": { "name": "Manula Thantriwatte", "email": "[email protected]", "username": "manulachathurika" }, "added": [ ], "removed": [ ], "modified": [ "www/sleep.php" ] }, "repository": { "id": 17658115, "name": "stratos2-test", "url": "https://github.com/manulachathurika/stratos2-test", "description": "Stratos2 Test", "watchers": 0, "stargazers": 0, "forks": 0, "fork": true, "size": 103, "owner": { "name": "manulachathurika", "email": "[email protected]" }, "private": false, "open_issues": 0, "has_issues": false, "has_downloads": true, "has_wiki": true, "language": "PHP", "created_at": 1394607356, "pushed_at": 1394632216, "master_branch": "master" }, "pusher": { "name": "manulachathurika", "email": "[email protected]" }}
