Question

I am using Enunciate to generate documentation for RestEasy services inside multi-module Maven project. I have some problems with doc generation when trying to get description of response object atributes.

For instance, if my service is defined as:

@GET
@Path("access/account")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Account getAccount(@Context HttpServletRequest hsr, @Context UriInfo info) throws RestApiException;

when the documentation is generated no atribute description is generated.

name                type    description
idProfile           int     (no documentation provided)
idLanguage          int     (no documentation provided)
idRegion            int     (no documentation provided)
userType            string  (no documentation provided) 

In all response objects I get only (no documentation provided). One important think is that all response classes are in different Maven module that the services are. The response classes are situated in the UTIL module. The services are situated in EJB module.

The reason for the problem is definitely multi-module Maven project, because if I define a response object that class is in the EJB module too, the documentation is perfect (also the description is generated).

The reason and also the solution is described here: https://github.com/stoicflame/enunciate/wiki/Multi-Module-Projects-%28Version-1%29

Despite all I still don't know what to do exactly and what to set inside different poms (EJB and UTIL) to solve my problem.

Any help is apreciated.

Was it helpful?

Solution

So have you tried to "import" the Account class as described in Multi-Module Projects?

<enunciate ...>
  <api-import pattern="com.mycompany.Account" />
  <api-import pattern="com.mycompany.*" />
  ...
</enunciate>

OTHER TIPS

Problem solved !!!

I had to:

  1. import the classes as Ryan said
  2. add maven-source-plugin in the pom.xml of the UTIL class where all response objects are located
  3. add description to get methods in reference class

The result is:

JSON
property    type    description
idProfile   int     Description B.
idLanguage  int     Description A.
idRegion    int     Description E.
userType    string  Description D.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top