带有Sphinx的RESTful Web Service API文档 [英] RESTful web service API documentation with Sphinx

查看:114
本文介绍了带有Sphinx的RESTful Web Service API文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ReST / Sphinx,RESTful Web服务的标记方法/ URL的最佳方式是什么?有没有一个默认域适用于使用可能的参数,HTTP方法,标头和正文内容来标记URL?

What's the best way to markup methods/URLs for a RESTful webservice using ReST/Sphinx? Is there a default domain that's suitable for marking up URLs with their possible parameters, HTTP methods, headers and body content?

以下行:

.. rest:method:: GET /api/foo

   :param bar: A valid bar
   :extension: json or xml

   Retrieve foos for the given parameters. E.g.::

      GET /api/foo.json?bar=baz

这样的事情已经存在了,还是默认的扩展名可以使用,还是自己写一个?

Does something like this already exist or is one of the default extensions usable, or will I have to write one myself?

推荐答案

Sphinx Contrib 项目似乎还有一个用于记录RESTful HTTP API的HTTP域包。您可以在 Python软件包站点上找到其文档。我不能说它的适应性:我只是开始研究狮身人面像,我也需要记录RESTful API,并注意到这个贡献的包。

The Sphinx Contrib project also seems to have an HTTP Domain package for documenting RESTful HTTP APIs. You can find its documentation on the Python packages site. I can't speak to its fitness: I'm only just starting to look into Sphinx, and I have a need to document RESTful APIs as well, and noticed this contributed package.

这篇关于带有Sphinx的RESTful Web Service API文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆