VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > Python基础教程 >
  • 使用apiDoc实现python接口文档编写

今天小编就为大家分享一篇使用apiDoc实现python接口文档编写,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

apiDoc的安装

npm install apidoc -g
点击官方文档

生成api的终端命令:apidoc -i 代码所在路径-o 生成文件的路径

接口文档的编写

文件的简介

project的介绍写在单独的json文件中apidoc.json:

{ "name": "project_name",
 
 "version": "0.1.0",
 
 "description": "who am i ,what i can do ",
 
 "title": " title of the html that generated by apiDoc",
 
 "sampleUrl" : "https://127.0.0.1:8000"}

具体api的书写模版

"""
@api {methods} url description
@apiName unique_name
@apiGroup group
 
@apiParam {type} field description
 
@apiSuccessExample {json} Success-Response:
HTTP/1.1 200 OK
  {
  "errno":200,
  "errmsg":errmsg,
  }
@apiError errortype description.
@apiErrorExample {json} Error-Response:
 HTTP/1.1 200 OK
 {
  "errno":401
  "errmsg": "UserNotFound"
  }
"""

以上这篇使用apiDoc实现python接口文档编写就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

原文链接:https://blog.csdn.net/zjh_lll/article/details/80093165


相关教程