This is an example for an extended version of a generated WADL, this is what's generated for the generate-wadl sample.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:application xmlns:ns2="http://research.sun.com/wadl/2006/10"> <ns2:doc xmlns:jersey="http://jersey.dev.java.net/" jersey:generatedBy="Jersey: 0.10-ea-SNAPSHOT 08/27/2008 08:24 PM"/> <ns2:doc xml:lang="en" title="The doc for your API"> This is a paragraph that is added to the start of the generated application.wadl </ns2:doc> <ns2:doc xml:lang="de" title="Die Dokumentation fuer Ihre API"> Dies in ein Abschnitt, der dem Beginn der generierte application.wadl hinzugefügt wird - in deutscher Sprache. </ns2:doc> <ns2:grammars> <ns2:include href="schema.xsd"/> </ns2:grammars> <ns2:resources base="http://localhost.localdomain.tld:9998/"> <ns2:resource path="items"> <ns2:doc>This is the root resource for managing items.<br /> Created on: Jul 20, 2008<br /></ns2:doc> <ns2:method name="POST" id="createItem"> <ns2:doc>Add a new item to the list of managed items. The item will get assigned an id, the resource where the item is available will be returned in the location header.</ns2:doc> <ns2:request> <ns2:representation xmlns:ns3="http://www.example.com" mediaType="application/xml" element="ns3:item"> <ns2:doc> <ns4:p xmlns:ns4="http://www.w3.org/1999/xhtml"> <ns4:h6>Example</ns4:h6> <ns4:pre> <ns4:code><?xml version="1.0" encoding="UTF-8" standalone="yes"?> <item xmlns="http://www.example.com">foo</item> </ns4:code> </ns4:pre> </ns4:p> </ns2:doc> </ns2:representation> </ns2:request> <ns2:response> <ns2:doc>The response with the status code and the location header.</ns2:doc> <ns2:param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:anyURI" style="header" name="Location"> <ns2:doc>The URI where the created item is accessable.</ns2:doc> </ns2:param> <ns2:representation mediaType="*/*"/> </ns2:response> </ns2:method> <ns2:resource path="{id}"> <ns2:doc>This resource is used to manage a single item.<br /> Created on: Jul 20, 2008<br /></ns2:doc> <ns2:param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="template" name="id"/> <ns2:method name="GET" id="getItem"> <ns2:doc>Returns the item if existing.</ns2:doc> <ns2:response> <ns2:representation xmlns:ns3="http://www.example.com" mediaType="application/xml" status="200" element="ns3:item"> <ns2:doc> <ns4:p xmlns:ns4="http://www.w3.org/1999/xhtml"> <ns4:h6>Example</ns4:h6> <ns4:pre> <ns4:code><?xml version="1.0" encoding="UTF-8" standalone="yes"?> <item xmlns="http://www.example.com">foo</item> </ns4:code> </ns4:pre> </ns4:p> </ns2:doc> </ns2:representation> </ns2:response> </ns2:method> <ns2:method name="GET" id="getItemAsJSON"> <ns2:doc>Returns the item if existing.</ns2:doc> <ns2:response> <ns2:representation mediaType="application/json" status="200"> <ns2:doc> <ns3:p xmlns:ns3="http://www.w3.org/1999/xhtml"> <ns3:h6>Example</ns3:h6> <ns3:pre> <ns3:code>["myValue"]</ns3:code> </ns3:pre> </ns3:p> </ns2:doc> </ns2:representation> </ns2:response> </ns2:method> <ns2:resource path="value/{value}"> <ns2:param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template" name="value"> <ns2:doc>the new value to set</ns2:doc> </ns2:param> <ns2:method name="PUT" id="updateItemValue"> <ns2:doc>Update the value property of the current item.</ns2:doc> </ns2:method> </ns2:resource> </ns2:resource> </ns2:resource> </ns2:resources> </ns2:application>
Comments (3)
Nov 09, 2008
Alexandre.Morgaut says:
Some comments about your doc elements of the application tag The specificatio...Some comments about your doc elements of the application tag
Nov 10, 2008
sandoz says:
I thought about utilizing the application tag instead but the WADL schema does n...I thought about utilizing the application tag instead but the WADL schema does not declare wild card attributes and thus the JAXB application class is that automatically generated from the schema does not have the ability to add any attribute. But the doc tag does
it was a lot easier in this respect to reuse that.
Martin, who created the example, lives in Germany, but i agree it should be "en" in this case.
Could you log an issue against this sample?
https://jersey.dev.java.net/issues/
Thanks,
Paul.
Feb 02, 2009
martin.grotzke says:
Hi Alexandre, (I didn't get notified by the wiki so that I had to notice this b...Hi Alexandre,
(I didn't get notified by the wiki so that I had to notice this by incident
)
thanx for the hint concerning the doc elements and the xml:lang attribute - now I understand the purpose of this
I changed the example on this page and also in the repository.
Cheers,
Martin