syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject [PROPOSAL] Get rid of JAXB
Date Tue, 05 Jul 2016 10:02:15 GMT
Hi all,
Syncope core is currently enabled with REST services which are available 
to work with both JSON and XML payloads; JSON support is provided via 
Jackson, XML via JAXB.

The recent SYNCOPE-884 brought again to my attention how difficult is to 
keep supporting both formats, especially considering that often JAXB 
does not provide anything special out-of-the-box (take the fix for 
SYNCOPE-884 [1] as an example of such troubles).

Hence, I went forward and provided a feature branch [2] where JAXB is 
compltely removed and XML payloads are instead managed via Jackson [3].
At present all tests are running fine, both with application/json and 
application/xml and the Swagger UI extension is working as well.

The benefits to me are: (1) manageability (no need to maintain two 
different sets of annotations) and possibly (2) performance - even 
though I realize that probably the vast majority is using application/json.

The only problem I can see, instead, is related to WADL: CXF's generator 
relies on JAXB for providing the <grammars> section, so currently no 
grammar is available and, as a consequence, there are no links to 
payload objects definition in the REST services documentation, as 
instead shown at [4].
To given an idea, when you go to [4], click on "numbers", then "GET 
(numbers)", you will see a modal window with a table under "Response" 
which shows a "syncope1:numbersInfo" link, bringing to the XSD reference 
of such object.
In [2], no link is shown.

There is the possibility of passing an existing XSD file to the WADL 
generator, but then the problem of generating such XSD file via Jackson 
arises, which is something I couldn't find a way to.

Questions:

 1. how do you see this feature (e.g. removing JAXB) in general?
 2. do you think that missing XSD from WADL is grave, considering that
    Swagger provides much more and is still working fine?
 3. any clever idea about pre-generating the XSD file from a bunch of
    Jackson-annotated POJOs?

Regards.

[1] https://git-wip-us.apache.org/repos/asf?p=syncope.git;h=4f6818b
[2] 
https://git-wip-us.apache.org/repos/asf?p=syncope.git;a=tree;h=refs/heads/2_0_NO_JAXB
[3] https://github.com/FasterXML/jackson-dataformat-xml
[4] http://syncope.apache.org/rest/2.0/index.html

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC,
CXF Committer, OpenJPA Committer, PonyMail PPMC
http://home.apache.org/~ilgrosso/


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message