Details

    • Type: Feature Request Feature Request
    • Status: Open Open (View Workflow)
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jaxrs
    • Labels:
      None
    • Environment:
      Any
    • Similar Issues:
      Show 10 results 

      Description

      By scanning javax.ws.rs.* annotation it should be relatively easy for RESTeasy to generate WADL resource in run-time.

      https://wadl.dev.java.net/
      http://en.wikipedia.org/wiki/Web_Application_Description_Language

        Activity

        Hide
        P Duffy
        added a comment -

        Vote # 2 for WADL generation. Particularly useful to generate client access libraries. I believe Jersey already supports this? Thanks

        Show
        P Duffy
        added a comment - Vote # 2 for WADL generation. Particularly useful to generate client access libraries. I believe Jersey already supports this? Thanks
        Hide
        Pablo Lalloni
        added a comment -

        I vote for this implemented too!

        And wonder about WSDL generation... is it already supported?

        Show
        Pablo Lalloni
        added a comment - I vote for this implemented too! And wonder about WSDL generation... is it already supported?
        Hide
        Mitchell Ackerman
        added a comment -

        Note that WADL can already be generated for a webapp via Maven and maven-wadl-plugin. See http://www.java.net/forum/topic/glassfish/glassfish/jersey-wadl-html-xsl-stylesheet. Although this is a Jersey plugin, it works equally well on RESTEasy apps.

        Show
        Mitchell Ackerman
        added a comment - Note that WADL can already be generated for a webapp via Maven and maven-wadl-plugin. See http://www.java.net/forum/topic/glassfish/glassfish/jersey-wadl-html-xsl-stylesheet . Although this is a Jersey plugin, it works equally well on RESTEasy apps.
        Hide
        Dave Horlick
        added a comment -

        Mitchell, I think the jersey-wadl-html-xsl stylesheet you refer to is for converting WADL to a human-readable, HTML format. What the ticket requests is a facility for generating WADL from javax.ws.rs.* annotations in services.

        Show
        Dave Horlick
        added a comment - Mitchell, I think the jersey-wadl-html-xsl stylesheet you refer to is for converting WADL to a human-readable, HTML format. What the ticket requests is a facility for generating WADL from javax.ws.rs.* annotations in services.
        Hide
        Mitchell Ackerman
        added a comment -

        The following maven plugins will achive what is wanted:

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.4</version>
        <executions>
        <execution>
        <goals>
        <goal>javadoc</goal>
        </goals>
        <phase>$

        {javadoc-phase}</phase>
        </execution>
        </executions>

        <configuration>

        <encoding>UTF-8</encoding>
        <verbose>false</verbose>
        <show>public</show>
        <subpackages>com.pgi.rest</subpackages>

        <doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet>
        <docletArtifacts>
        <docletArtifact>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>wadl-resourcedoc-doclet</artifactId>
        <version>${jersey-release-version}</version>
        </docletArtifact>
        <!--
        Also specify jersey and xerces as doclet artifacts as the ResourceDoclet
        uses classes provided by them to generate the resourcedoc.
        -->
        <docletArtifact>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>${jersey-release-version}</version>
        </docletArtifact>
        <docletArtifact>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.6.1</version>
        </docletArtifact>
        </docletArtifacts>
        <additionalparam>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalparam>

        </configuration>
        </plugin>
        <plugin>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>maven-wadl-plugin</artifactId>
        <version>${jersey-release-version}</version>
        <executions>
        <execution>
        <id>generate</id>
        <goals>
        <goal>generate</goal>
        </goals>
        <phase>${javadoc-phase}

        </phase>
        </execution>
        </executions>
        <configuration>
        <wadlFile>$

        {project.build.outputDirectory}/application.wadl</wadlFile>
        <formatWadlFile>true</formatWadlFile>
        <baseUri>http://hostname:8080/BobApp</baseUri>
        <packagesResourceConfig>
        <param>com.pgi.bob.rest</param>
        </packagesResourceConfig>
        <wadlGenerators>
        <wadlGeneratorDescription>
        <className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc</className>
        <properties>
        <property>
        <name>applicationDocsFile</name>
        <value>${basedir}/src/main/doc/application-doc.xml</value>
        </property>
        </properties>
        </wadlGeneratorDescription>
        <wadlGeneratorDescription>
        <className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport</className>
        <properties>
        <property>
        <name>grammarsFile</name>
        <value>${basedir}/src/main/doc/application-grammars.xml</value>
        </property>
        </properties>
        </wadlGeneratorDescription>
        <wadlGeneratorDescription>
        <className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport</className>
        <properties>
        <property>
        <name>resourceDocFile</name>
        <value>${project.build.outputDirectory}

        /resourcedoc.xml</value>
        </property>
        </properties>
        </wadlGeneratorDescription>
        </wadlGenerators>
        </configuration>
        </plugin>
        <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xml-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
        <execution>
        <phase>$

        {javadoc-phase}

        </phase>
        <goals>
        <goal>transform</goal>
        </goals>
        </execution>
        </executions>
        <configuration>
        <transformationSets>
        <transformationSet>
        <dir>$

        {project.build.directory}

        /classes</dir>
        <includes>
        <include>**/application.wadl</include>
        </includes>
        <outputDir>target/generated-resources</outputDir>
        <!-- <stylesheet>src/main/doc/wadl_documentation.xsl</stylesheet> -->
        <stylesheet>src/main/doc/wadl.xsl</stylesheet>
        <outputProperties>
        <outputProperty>
        <name>standalone</name>
        <value>yes</value>
        </outputProperty>
        </outputProperties>

        <fileMappers>
        <fileMapper
        implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
        <targetExtension>.html</targetExtension>
        </fileMapper>
        </fileMappers>
        </transformationSet>
        </transformationSets>
        </configuration>
        </plugin>

        Show
        Mitchell Ackerman
        added a comment - The following maven plugins will achive what is wanted: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.4</version> <executions> <execution> <goals> <goal>javadoc</goal> </goals> <phase>$ {javadoc-phase}</phase> </execution> </executions> <configuration> <encoding>UTF-8</encoding> <verbose>false</verbose> <show>public</show> <subpackages>com.pgi.rest</subpackages> <doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet> <docletArtifacts> <docletArtifact> <groupId>com.sun.jersey.contribs</groupId> <artifactId>wadl-resourcedoc-doclet</artifactId> <version>${jersey-release-version}</version> </docletArtifact> <!-- Also specify jersey and xerces as doclet artifacts as the ResourceDoclet uses classes provided by them to generate the resourcedoc. --> <docletArtifact> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server</artifactId> <version>${jersey-release-version}</version> </docletArtifact> <docletArtifact> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.6.1</version> </docletArtifact> </docletArtifacts> <additionalparam>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalparam> </configuration> </plugin> <plugin> <groupId>com.sun.jersey.contribs</groupId> <artifactId>maven-wadl-plugin</artifactId> <version>${jersey-release-version}</version> <executions> <execution> <id>generate</id> <goals> <goal>generate</goal> </goals> <phase>${javadoc-phase} </phase> </execution> </executions> <configuration> <wadlFile>$ {project.build.outputDirectory}/application.wadl</wadlFile> <formatWadlFile>true</formatWadlFile> <baseUri> http://hostname:8080/BobApp </baseUri> <packagesResourceConfig> <param>com.pgi.bob.rest</param> </packagesResourceConfig> <wadlGenerators> <wadlGeneratorDescription> <className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc</className> <properties> <property> <name>applicationDocsFile</name> <value>${basedir}/src/main/doc/application-doc.xml</value> </property> </properties> </wadlGeneratorDescription> <wadlGeneratorDescription> <className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport</className> <properties> <property> <name>grammarsFile</name> <value>${basedir}/src/main/doc/application-grammars.xml</value> </property> </properties> </wadlGeneratorDescription> <wadlGeneratorDescription> <className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport</className> <properties> <property> <name>resourceDocFile</name> <value>${project.build.outputDirectory} /resourcedoc.xml</value> </property> </properties> </wadlGeneratorDescription> </wadlGenerators> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xml-maven-plugin</artifactId> <version>1.0</version> <executions> <execution> <phase>$ {javadoc-phase} </phase> <goals> <goal>transform</goal> </goals> </execution> </executions> <configuration> <transformationSets> <transformationSet> <dir>$ {project.build.directory} /classes</dir> <includes> <include>**/application.wadl</include> </includes> <outputDir>target/generated-resources</outputDir> <!-- <stylesheet>src/main/doc/wadl_documentation.xsl</stylesheet> --> <stylesheet>src/main/doc/wadl.xsl</stylesheet> <outputProperties> <outputProperty> <name>standalone</name> <value>yes</value> </outputProperty> </outputProperties> <fileMappers> <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper"> <targetExtension>.html</targetExtension> </fileMapper> </fileMappers> </transformationSet> </transformationSets> </configuration> </plugin>
        Hide
        Anita Fronczak
        added a comment -

        The above solution has one problem. I have tried it and maven-wadl-plugin does not see transitive dependencies in maven. Errors like this: <code>java.lang.TypeNotPresentException: Type javax.persistence.EntityManager not present</code> occur if javax.persistence is added as dependency via some other dependency (like eclipselink). If I add some other project to my rest project and all dependencies are transitive iI have a problem.

        Show
        Anita Fronczak
        added a comment - The above solution has one problem. I have tried it and maven-wadl-plugin does not see transitive dependencies in maven. Errors like this: <code>java.lang.TypeNotPresentException: Type javax.persistence.EntityManager not present</code> occur if javax.persistence is added as dependency via some other dependency (like eclipselink). If I add some other project to my rest project and all dependencies are transitive iI have a problem.
        Hide
        sarab singh
        added a comment -

        Another #vote for wadl generation. My Company started using RestEasy as Rest WS framework. Need to have wadl generated at runtime to what is being published where. Thanks

        Show
        sarab singh
        added a comment - Another #vote for wadl generation. My Company started using RestEasy as Rest WS framework. Need to have wadl generated at runtime to what is being published where. Thanks

          People

          • Assignee:
            Bill Burke
            Reporter:
            Yuriy ZUbarev
          • Votes:
            94 Vote for this issue
            Watchers:
            61 Start watching this issue

            Dates

            • Created:
              Updated: