Question

Im using enunciate to document my REST API. Im able to generate docs properly and have been using it for quite some time.

My issue now is.. Ive few Service classes with multiple endpoint methods.

public interface UserLoginService {
//This method should be DOcumented
@Path("/login")
@POST
@Consumes({"application/xml", "application/json"})
@Produces({"application/xml", "application/json"})
@Transactional(
 readOnly=false, 
rollbackForClassName="MyExceptionClass", 
propagation=Propagation.REQUIRED
)
@Deprecated
public UserDetails performLogin(LoginObj loginobj);


//This method should be skipped

@Path("/logout")
@GET
@Consumes({"application/xml", "application/json"})
@Produces({"application/xml", "application/json"})
@Transactional(
readOnly=false, 
rollbackForClassName="MyException", 
propagation=Propagation.REQUIRED
)
public UserDetails logout(@QueryParam("userid") String userid);
}

In those service methods some are public and some are used internally. I wanted to generated doc for only those Rest methods which are supposed to be public. I searched in enunciate couldnt find anyway to skip few methods , though im using exclude api classes to exclude classes. Is there any way this can be achieved. I dont want to create separate classes only bcoz of documentation. If enunciate dosent do this any other doc tools which can be easily adapted from existing enunciate javadoc written.

Was it helpful?

Solution 2

I was using the old version of enunciate. The latest version has an annotation @ExcludeFromDocumentation. Though I saw this annotation It was written in doc that this is applicable for only Jaxb objs. I saw in their jira a defect raised and fixed for my issue. This annotation now can be used for classes/methods . If used against a REST method then the method will not be documented.

OTHER TIPS

FYI, version 1.27 will include the notion of Enunciate Facets that are more flexible in excluding facets of your API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top