基于rest api的sphinx gen doc工具
sphinxcontrib-sphinx-rest-api-doc的Python项目详细描述
来自json api的sphinx gen doc工具
概述
在此处添加更长的描述。
安装
pip install sphinxcontrib-sphinx-rest-api-doc
基本用法
.. rest: path_to_model.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.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"