【发布时间】:2012-05-21 05:47:25
【问题描述】:
here 和 here 提出了两个类似的问题,但没有给出足够的答案。
我发现我可以使用Enunciate 为 RestEasy 服务创建 WADL。于是我试了一下。
在我的一项服务中,我有一个映射到 HTTP GET 的方法,我正在使用如下所示
...
import org.jboss.resteasy.annotations.Form;
...
@GET
@Produces({MediaType.APPLICATION_JSON})
@Transactional(readOnly = true)
public WebServicePageResponse<D> find(@Form WebServicePageRequest<E> wsPageRequest)
{
...
}
Enunciate 在生成 WADL 之前对服务方法进行验证,并抛出此错误并失败
"A resource method that is mapped to HTTP GET must not specify an entity parameter."
@Form 是 RestEasy 特定的注解,而 Enunciate 只能解析 JSR-311 的注解。
有没有人做过类似的事情?有没有人成功地使用 Enunciate 为 RestEasy 服务生成文档?有其他选择吗?
【问题讨论】: