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? 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, Sergey > >> > >> > >> > >>> > >>> Thanks ! > >>> > >>> > >>> { > >>> "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]" > >>> }} > >>> > >>> > >>> > > > >
