使用带有spring框架的eNaciate 2.6
我有一个Spring4应用程序,我试图记录RESTAPI 在my pom.xml中:使用带有spring框架的eNaciate 2.6,spring,rest,enunciate,Spring,Rest,Enunciate,我有一个Spring4应用程序,我试图记录RESTAPI 在my pom.xml中: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<sourcepath-includes>
<include>
<groupId>org.springframework.data</groupId>
</include>
</sourcepath-includes>
<configFile>${basedir}/src/main/resources/doc/enunciate/config.xml</configFile>
</configuration>
<executions>
<execution>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
org.springframework.boot
springbootmaven插件
阐明
阐明maven插件
2.6.0
org.springframework.data
${basedir}/src/main/resources/doc/enuciate/config.xml
集合
my Enounciate.xml文件:
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.6.0.xsd">
<title> TITLE </title>
<description>desc .... </description>
<copyright>copyright</copyright>
<api-classes>
<include pattern="com.myexample.**"/>
<include pattern="org.springframework.data.domain.Pageable"/>
<include pattern="org.springframework.data.domain.Page"/>
<include pattern="org.springframework.data.domain.Slice"/>
</api-classes>
<modules>
<docs docsSubdir="enunciate/docs" />
<spring-app disable="false" springVersion="4.2.4" />
<spring-web disable="false" datatype-detection="aggressive" />
<!--<gwt-json-overlay disabled="true"/>
<obj-c-xml-client disabled="true"/>
<php-xml-client disabled="true"/>
<php-json-client disabled="true"/>
<ruby-json-client disabled="true"/>
<xml disabled="true"/>
<c-xml-client disable="true"/>
<swagger disabled="true"/>
<java-client disabled="true"/>
<java-json-client disabled="true"/>
<javascript-client disabled="true"/>
<csharp-xml-client disabled="true"/>
<java-xml-client disabled="true"/>
<c disabled="true"/>
<idl disabled="true"/>
<basic-app disabled="true" />-->
</modules>
标题
描述。。。。
版权
我在控制器中的简单方法:
/**
* docs for method getUsers .....
*
* @param pageable org.springframework.data.domain.Pageable
* @return org.springframework.data.domain.Page
*
*/
//@com.webcohesion.enunciate.metadata.rs.TypeHint(value = PageDoc.class)
@RequestMapping(method = RequestMethod.GET)
public Page<User> getUsers(Pageable pageable)
{
List<User> users = userDatastore.findAll(0, 10);
//Pageable pageable = new PageRequest(0, 5, new Sort(Sort.Direction.ASC, "username"));
System.out.println("pageable : " + pageable.toString());
return new PageImpl<User>(users, pageable, 10);
}
/**
*方法getUsers的文档。。。。。
*
*@param pageable org.springframework.data.domain.pageable
*@return org.springframework.data.domain.Page
*
*/
//@com.webcohesion.enunciate.metadata.rs.TypeHint(value=PageDoc.class)
@RequestMapping(method=RequestMethod.GET)
公共页面getUsers(可分页可分页)
{
List users=userDatastore.findAll(0,10);
//Pageable Pageable=新的页面请求(0,5,新排序(Sort.Direction.ASC,“用户名”);
System.out.println(“pageable:+pageable.toString());
返回新的PageImpl(用户,可分页,10);
}
问题是Denuciate没有记录页面和可分页类。你知道我该怎么做吗