chris snow opened SPR-8705 and commented
It would be good if Spring MVC Rest services could automatically generate a WADL. This will make the rest services much each to use in service (e.g. SOA) environments.
25 votes, 33 watchers
Comment From: spring-projects-issues
Tomasz Nurkiewicz commented
I wrote a simple WADL generator (see: Automatically generating WADL in Spring MVC REST application). The basic idea is to translate mapping found in RequestMappingHandlerMapping bean into WADL/JAXB classes. Not really that complicated.
Comment From: spring-projects-issues
Anup Awasthi commented
It is great help. I will try this in my project and let's see how far I go..
Comment From: spring-projects-issues
Rossen Stoyanchev commented
Thank you Tomasz for sharing that.
In your blog you refer to a requirement to document and catalog all available resources and operations. You also mention the ability to use soapUI to show a tree of resources. I wonder if you could expand a bit more on your motivation for WADL? As a form of documentation it doesn't seem particularly well suited for human consumption, at least not without some additional API notes and comments along with a transformation into HTML. Or is it primarily about the ability to quickly create requests with tools like soapUI specifically where requests contain XML content.
It would also be good to hear from others with thoughts on the subject (or see votes).
Comment From: spring-projects-issues
Tomasz Nurkiewicz commented
Well, I don't want to turn this issue into a discussion Do we need WADL? Some people will love it, others will hate (claiming that REST should be self-descriptive) and some will just ignore it. But keep in mind that most of major JAX-RS implementations generate WADL from code automatically.
In my use case I was getting a bit lost in a plethora of controllers and mappings. My security is based on URLs and it was getting increasingly hard to find out what URLs I have and which HTTP methods do they support. Also it is not always obvious which Java method stands behind which URI. Ability to visualize it in soapUI is great, but for human-readable documentation obviously you need e.g. some XSLT transformation.
I don't consider WADL a must or "the right way" - I just think some people might benefit from it and since I already did some implementation sketch, I though about contributing the idea.
Comment From: spring-projects-issues
Adithya Raghuraman commented
I agree with Tomasz in that WADL support in spring would be helpful for several developers.I felt a kinship with Tomasz when I developed a huge set of RESTful web services and and had to describe it to clients who are going to use integrate those services. I personally don't believe that the majority of services that we need to develop right now is suited to be a RESTful service, given the simplistic requirements of REST. But given the wide adoption of WADL ( though it seems to be going the SOAPful way of becoming complicated ), the expectations of the integrating team towards a RESTful web service seems to be availability of a WADL in many cases and asking them to just look at the urls and the example request data just doesnt look right.
Comment From: spring-projects-issues
Grégory Oliver commented
I have created a WadlGenerator controller in java based on the Tomasz Nurkiewicz article. Perhaps it can help to integrate it in Spring ? http://tuxgalaxy.blogspot.com/2012/03/spring3-et-wadl-generation.html
Comment From: spring-projects-issues
Ilinca Vintila Hallberg commented
+1 for adding wadl generation. I've tried the available scala library, it works pretty good for small projects but in larger projects it seems to be causing some severe memory issues (had to disable it, since it was causing GC overhead limit exceeded). Would be great to see this as part of spring.
Comment From: spring-projects-issues
Tomasz Nurkiewicz commented
@Ilinca
Vintila Hallberg - could you provide some more details about this problem? I am eager to fix it so the reference Scala implementation is bug free. You comment under original article.
Comment From: spring-projects-issues
Anup Awasthi commented
Can we use this directly in our java project or we have to create java counterpart project of this ?
Comment From: spring-projects-issues
Gregory bonk commented
We're primarily SOAP and just starting some REST. A WADL would really help our customer's comfort level, and our experience with Spring WS contract first concept. I'd like to see this in spring by default. The WadlGenerators mentioned above work nicely.
Comment From: spring-projects-issues
Destan Sarpkaya commented
hi spring team,
any intentions on adding this feature?
Comment From: spring-projects-issues
SANKARA TELUKUTLA commented
Some customer wanted to see the wadl file to generate client java code. Please suggest if we have any other alternative.
Comment From: spring-projects-issues
Mourad Jaber commented
Hi,
I hope this feature could be implemented as some JAX-RS implementation...
As a workaround, I found this maven plugin : https://github.com/autentia/wadl-tools/tree/master/spring-wadl-generator it does the job for my needs...
Regards
Comment From: bclozel
Several Spring and 3rd party projects are handling the API format spec and documentation aspects - there are still quite a few choices out there, but WADL isn't the popular choice these days. We won't be addressing this feature in Spring Framework as a result.