我试图将模型类导入到发音文档中,但我在 Maven 日志中得到以下信息:
Class com.mycompany.model.MyClass was explicitly imported, but it was not found on the classpath. We'll try to import it anyway.
我试图在我的发音生成文档中包含请求和响应类。但是,我得到的只是以下内容:
POST
Request Body
element: (custom)
media types: application/json
(no documentation provided)
Response Body
element: (custom)
media types: application/json
(no documentation provided)
发音.xml
<?xml version="1.0"?>
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.27.xsd">
<api-import pattern="com.mycompany.model.*" />
<api-import pattern="com.mycompany.model.MyClass" />
<api-classes>
<include pattern="com.mycompany.common.imrest.model.*"/>
<include pattern="com.mycompany.model.MyClass"/>
</api-classes>
</enunciate>
pom.xml
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.27</version>
<configuration>
<configFile>enunciate.xml</configFile>
</configuration>
<executions>
<execution>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
另外,第二个问题。有没有办法在文档中包含示例 JSON 请求和响应?