Martin,我一直試圖使用您的wadl文檔生成代碼來記錄來自Javadoc註釋的REST接口,並且我一直無法獲取它來記錄參數方法/查詢參數。我不太確定我做錯了什麼。我以通常的方式向該方法提供Javadoc評論,例如:如何獲取WADL生成的文檔中的參數描述
/**
* Gets an Account object by id.
* @param req the HttpServletRequest encapsulating this GET request
* @param q the id of the Account object to be returned
* @param xid optional transaction id associated with this request
* @return an AccountModel object corresponding to the requested it.
* If not found an APIException is thrown.
*/
@GET @Path("/id")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public AccountModel getAsXML_JSON(@Context final HttpServletRequest req,
@QueryParam("q") String q,
@QueryParam("xid") String xid)
我確定有些事情顯而易見,我錯過了。如上所述,註釋「通過ID獲取帳戶對象」使其成爲resourcedoc.xml文件,並從那裏到application.wadl文件,但沒有任何參數定義可用。 當我添加
* @annotationDoc {@name q} {@doc the id of the Account object to be returned}
* @annotationDoc {@name xid} {@doc optional transaction id associated with this request}
我可以看到在resourcedoc.xml文件中的參數的描述,但它看起來像他們在錯誤的地方正在出現,並沒有在application.wadl文件顯示出來。 你可以給任何幫助將不勝感激。