2

There are two similar questions asked here and here but no adequate answers are given.

I found that I can use Enunciate to create WADL for a RestEasy service. So I tried it.

In one of my services I have a method mapped to HTTP GET which I am using like below

...
import org.jboss.resteasy.annotations.Form;
...
@GET
@Produces({MediaType.APPLICATION_JSON})
@Transactional(readOnly = true)
public WebServicePageResponse<D> find(@Form WebServicePageRequest<E> wsPageRequest)
{
    ...
}

Enunciate performs a validation on the service methods before it generates the WADL, and throws this error and fails

"A resource method that is mapped to HTTP GET must not specify an entity parameter."

@Form is a RestEasy specific annotation, while Enunciate can only parse JSR-311 annotations.

Has anyone done something similar? Has anyone successfully used Enunciate to generate documentation for a RestEasy service? Are there any alternatives?

Community
  • 1
  • 1
gresdiplitude
  • 1,665
  • 1
  • 15
  • 27

2 Answers2

0

Looks like a great suggestion for a new feature. Tracking it here.

It might be an awkward workaround, but have you tried using the signature override?

Ryan Heaton
  • 1,173
  • 7
  • 11
  • thanks, that looks like a neat trick. For now however I have just removed the @Form annotation and replaced it with the individual annotations it was encapsulating. – gresdiplitude May 25 '12 at 10:08
  • I've added my vote to the JIRA - the @Form functionality is really useful in RESTEasy, and the lack of support for it means we can't start using Enunciate. – user1180316 Jul 18 '12 at 14:45
0

The best solution I found to this was to remove @Form annotation and use the individual annotations instead (enter link description hereatleast till Enunciate start supporting this).

gresdiplitude
  • 1,665
  • 1
  • 15
  • 27