https://github.com/yishenggudou/sphinx-rest-api-doc
rest api example
https://github.com/yishenggudou/sphinx-rest-api-doc
docs python python36 sphinx sphinx-extension
Last synced: 5 months ago
JSON representation
rest api example
- Host: GitHub
- URL: https://github.com/yishenggudou/sphinx-rest-api-doc
- Owner: yishenggudou
- License: bsd-2-clause
- Created: 2018-10-09T15:07:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T15:42:47.000Z (over 7 years ago)
- Last Synced: 2025-09-18T01:37:14.890Z (9 months ago)
- Topics: docs, python, python36, sphinx, sphinx-extension
- Language: Python
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: ChangeLog
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
=====================================
sphinxcontrib-sphinx-rest-api-doc
=====================================
.. image:: https://travis-ci.org/yishenggudou/sphinxcontrib-sphinx-rest-api-doc.svg?branch=master
:target: https://travis-ci.org/yishenggudou/sphinxcontrib-sphinx-rest-api-doc
.. image:: https://badge.fury.io/py/sphinxcontrib-sphinx-rest-api-doc.svg
:target: https://badge.fury.io/py/sphinxcontrib-sphinx-rest-api-doc
a tools for sphinx gen doc from json api
Overview
--------
Add a longer description here.
INSTALL
--------------------
.. code-block:: bash
pip install sphinxcontrib-sphinx-rest-api-doc
Basic usage
----------------------
.. code-block:: rst
.. rest: path_to_model.json
example in model file
----------------------
.. code-block:: json
{
"title": "测试资源",
"desc": "测试测试测试",
"method": {
"get": {
"list": false,
"path": "/api/xx/xx/xx",
"params": {
"id":"ddede"
},
"desc": "dwdwedewfeferferferferfewr",
"headers": {
"auth":"auth"
},
"codes": {
"400":"de",
"200":"2"
}
}
},
"model": {
"id":"",
"desc":"dede"
}
}
CONFIG
----------
in config.py
.. code-block:: py
extensions += ['sphinxcontrib.SphinxRest',]
rest_api_source_root = os.path.join(PROJECT_DIR, "_static", "models")
rest_api_domain = "timger.com.cn"
rest_api_http_request_example_title = "Request Example"
rest_api_http_response_example_title = "Response Example"
Links
-----
- Source: https://github.com/yishenggudou/sphinxcontrib-sphinx-rest-api-doc
- Bugs: https://github.com/yishenggudou/sphinxcontrib-sphinx-rest-api-doc/issues
- BLOG: http://www.timger.com.cn/