简体   繁体   中英

exlude few rest methods from enunciate doc tool

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.

仅供参考,版本1.27将包含“阐明方面”的概念,该概念在排除API方面方面更为灵活。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM