Question

I have a Spring 3 application that I am trying to generate robust api documention against. I have tried a few different projects and am seeing if enunicate(http://enunciate.codehaus.org) will suit my needs including the ability to generate swagger formatted docs.

I have added the dependency to my pom.xml file as follows

        <plugin>
            <groupId>org.codehaus.enunciate</groupId>
            <artifactId>maven-enunciate-spring-plugin</artifactId>
            <version>1.27</version>
            <configuration>
                <configFile>enunciate.xml</configFile>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>assemble</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

and have created a simple enunciate.xml file in the root of my app as:

<?xml version="1.0"?>
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.28.xsd">   
<services>
    <rest defaultRestSubcontext="/"/>
    <soap defaultSoapSubcontext="/"/>
</services>
<webapp mergeWebXML="src/main/webapp/WEB-INF/web.xml" />
<modules>
    <spring-app disabled="false"></spring-app>
    <docs docsDir="api" splashPackage="com.welflex.rest" title="Web Service API"
        copyright="MyCo"/>
    <obj-c disabled="true"></obj-c>
    <c disabled="true"/>
    <csharp disabled="true"></csharp>
    <swagger disabled="false"></swagger>
</modules>
</enunciate>

When I run mvn clean package against my project only a couple of classes that have jax-ws annotations are picked up.

Does anyone have a working sample of Spring/REST/JSON controllers working with enunciate?

Thanks!

Was it helpful?

Solution

Unfortunately, Enunciate only supports standard JAX-RS interface annotations. Spring MVC isn't supported yet. Here's where we're tracking that work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top