REST WADL:有什么风格指南或好的例子吗?
有很多优秀的示例和指南(请参阅参考文献 [1])用于为 Java 代码编写良好的 javadoc
通过 WADL 记录我们的 REST 接口
我们正在使用 Restlet http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/72-restlet.html
引用该教程,我们添加了如下代码...
@Override
protected void describeDelete(MethodInfo info) {
info.setDocumentation("Delete the current item.");
RepresentationInfo repInfo = new RepresentationInfo();
repInfo.setDocumentation("No representation is returned.");
repInfo.getStatuses().add(Status.SUCCESS_NO_CONTENT);
info.getResponse().getRepresentations().add(repInfo);
}
是否有良好的简洁 WADL 的编码标准或示例。例如,我们不想重复 HTTP 动词或 URL 中隐含的信息。
参考 1. 如何为 Javadoc 工具编写文档注释。 我无法添加 URL,因为我是新用户,但我的意思是指南位于
www.oracle.com/technetwork/java/javase/documentation/index-137868.html
There are plenty of excellent examples and guidelines (see ref [1]) for writing good javadoc for Java code
We are documenting our REST interfaces via WADL using Restlet
http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/72-restlet.html
Quoting that tutorial we are adding code like ...
@Override
protected void describeDelete(MethodInfo info) {
info.setDocumentation("Delete the current item.");
RepresentationInfo repInfo = new RepresentationInfo();
repInfo.setDocumentation("No representation is returned.");
repInfo.getStatuses().add(Status.SUCCESS_NO_CONTENT);
info.getResponse().getRepresentations().add(repInfo);
}
Are there coding standards or examples of good succinct WADL . e,g, we dont want to duplicate info that is implicit in the HTTP verb or the URL.
Ref 1. How to Write Doc Comments for the Javadoc Tool.
I cant add the URL as I am new user but I mean the guidelines at
www.oracle.com/technetwork/java/javase/documentation/index-137868.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RESTful 系统中唯一需要任何附加文档的部分是自定义媒体类型和自定义链接关系。
这样想,您向网络浏览器供应商提供了哪些文档,以便用户可以访问您的公司网站?
The only part of a RESTful system that needs any additional documentation is custom media types and custom link relations.
Think of it this way, what documentation did you provide to the web browser vendors so that users could access your corporate web site?