5

我的 RESTEasy 代码中有以下注释:

@Path("/v1/authenticateService")

Enunciate 在文档中生成一个“挂载点”,如下所示:

/rest/v1/authenticateService/authenticate

我尝试在我的 enunciate.xml 中使用以下内容来覆盖“/rest”上下文:

<services>
    <rest defaultRestSubcontext="/gateway-service-access-pox" />
</services>

我也尝试了以下方法,但它也没有做任何事情:

<deployment protocol="https" host="(host)" context="/gateway-service-access-pox" />

我正在使用 enunciate 1.23 为 Maven 3 多模块项目生成文档。

以下是写入控制台的内容:

[INFO] --- maven-site-plugin:3.0:site (default-cli) @ gateway-service-access-pox ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.4
[INFO] configuring report plugin org.codehaus.enunciate:maven-enunciate-plugin:1.23
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating "About" report    --- maven-project-info-reports-plugin:2.4
[INFO] Generating "Web Service API" report    --- maven-enunciate-plugin:1.23
[INFO] initializing enunciate.
[INFO] invoking enunciate:generate step...
[INFO] invoking enunciate:compile step...
[INFO] invoking enunciate:build step...
[INFO] closing enunciate.

知道我做错了什么吗?

更多信息... 完整的 enunciate.xml(以防出现影响条目的问题:

<?xml version="1.0"?>
<enunciate label="platform-gateway-api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.23.xsd">

<api-import pattern="com.intuit.platform.gateway.common.DetailedResponse" />
<api-import pattern="com.intuit.platform.gateway.service.access.domain.*" />
<api-import pattern="com.intuit.platform.gateway.service.identity.domain.Identity" />

<deployment protocol="https" host="(host)" context="/gateway-service-access-pox" />

<namespaces>
    <namespace uri="http://schema.intuit.com/platform/integration/detailedResponse/v1" id="common" />
    <namespace uri="http://schema.intuit.com/platform/identity/user/v1" id="user" />
    <namespace uri="http://schema.intuit.com/platform/access/token/v1" id="token" />
</namespaces>

<services>
    <rest defaultRestSubcontext="/gateway-service-access-pox" />
</services>

<modules>
    <!-- Docs -->
    <docs splashPackage="com.intuit.platform.gateway.service.ticket.api" title="Platform Gateway Access API"
        copyright="Intuit Inc">
        <download name="License" file="LICENSE.txt" description="The license file governing the use of this API." />
    </docs>
    <!-- Disable all the client generation tools -->
    <basic-app disabled="true" />
    <c disabled="true" />
    <csharp disabled="true" />
    <java-client disabled="true" />
    <jaxws-client disabled="true" />
    <jaxws-ri disabled="true" />
    <jaxws-support disabled="true" />
    <jersey disabled="true" />
    <obj-c disabled="true" />
    <xml disabled="true" />
</modules>
</enunciate>

顺便说一句,如果有更好的方法来获得这个问题的帮助(某种错误论坛),请告诉我。我是一个发音清晰的新手,不知道这是一个错误还是我的无知。

4

2 回答 2

2

正如瑞安所说,“defaultRestSubcontext”有效。例如,我用这种方式从默认生成的挂载点中删除“rest”:

<services>
<rest defaultRestSubcontext="/" />
</services>

如果将 defaultRestSubcontext 设置为“/”,则生成从“/”开始,然后是端点的路径。

PS 我正在使用 Enunciate 1.24

于 2011-12-21T16:49:29.060 回答
1

好吧...我已经在这附近待了几天,终于它可以工作了,并且挂载点具有适当的默认休息子上下文:)

2 我为使它工作所做的事情。

  1. 启用 XML 模块

    <xml disabled="false" />
    
  2. 将 enunciate-xml jar 添加到运行时。

我不知道为什么会这样,但它现在对我有用。

于 2012-10-04T11:41:27.110 回答