Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash REST WADL

Will Dowling October 21, 2013

Hey all,

Trying to use the Apache CXF wadl2java tool to generate JAX-RS client bindings for the Stash REST API (and will need to for other Atlassian tools shortly).

It looks like the WADLs listed up on Atlassian's developer pages (here) contains multiple resource definitions, and won't code generate with any wadl2java tools.

Is there a set of REST bindings for Stash available via Maven? I'm integrating a separately hosted app, so don't believe the stash-api artifact is of any use to me.

Failing that, are there any WADL files available that only contain single resource definitions?

Cheers :)

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2013

Hi Will,

How annoying of CXF. We're generating our WADL using Jersey.

Just playing with it locally, it's not got nothing to do with multiple resources (despite the error). From looking at the source, if you change the namespace to xmlns:ns2="http://wadl.dev.java.net/2009/02" it starts to work.

At that point it complains about schema.xsd not being found - you can just delete the <ns2:include href="schema.xsd"/> element.

Then it starts complaining about "WADLToJava Error: Unsupported parameter style" (not very helpful).

You can fix that by changing anything with an empty style="" to 'query' ie:

<ns2:param type="xs:string" style="" name="avatar"

(There should be three param elements missing a style - looks like that's related to our only multipart source for submitting a project avatar)

Also, I using the wadl2java here I managed to get the following to work without having to fix the namespace or params (the include still needed to be removed though).

wadl2java -o . -s jaxrs20 -p my.org stash-rest.wadl.xml

Regarding Maven, you could possibly include stash-api and stash-rest-common as jars in your project, and use our Rest* classes with Jackson, which are used to generate the WADL in the first place.

I hope that helps.

Charles

TAGS
AUG Leaders

Atlassian Community Events