从sphinx文档生成夸张的定义

sphinx-swagger的Python项目详细描述


直接从基于httpdomain的 文档。

用法

  1. 通过添加^{tt1},在conf.py中启用扩展$ 到extensions列表
  2. 运行swaggerbuilder(例如,setup.py swagger
  3. 使用生成的swagger.json

setuptools命令

此库安装名为swagger的新命令 从setup.py实用程序。它运行狮身人面像来产生招摇 输出文件。它类似于运行sphinx-build-b swagger,除了 它可以访问您的包元数据,因此您不必 在两个地方配置它!

这是使用此软件包的推荐方法。

您可以在项目的setup.cfg中配置输出文件名 [swagger]部分:

[swagger]
output-file = static/swagger.json

这使得直接将它包含到构建的工件中变得更容易 在setup.py中将其添加为package_data。记得把它加到 您的manifest.in也在中。

配置

此扩展包含一些有用的配置值,可以是 从sphinx配置文件中设置。

swagger_description:
Sets the description of the application in the generated swagger file. If this is not set, then the “description” value in ^{tt8}$ will be used if it is set.
swagger_file:Sets the name of the generated swagger file. The file is always generated in the sphinx output directory – usually build/sphinx/swagger. The default file name is swagger.json.
swagger_license:
A dictionary that describes the license that governs the API. This is written as-is to the License section of the API document. It should contain two keys – name and url.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java hql中的新关键字是如何工作的?   java将十六进制转换为INT 32和字符串Little Endian   java无法通过jdbc从sql表中获取数据   java RelaxNG:在jar中合并语法   java如何向vaadin网站添加javascript插件   java如何读取没有大括号的循环?   用Java解析地址解析器   java使用mavenshadeplugin排除路径   java无法使用spring安全性进行身份验证。输入凭据后   java从输入读取字符   java Elasticsearch因NoNodeAvailableException失败   java将图像匿名上传到Imgur   没有internet连接时的java SocketException   java如何以正确的方式关闭socket?   java ListView删除下面的按钮   在eclipse中运行junit testcase时发生java错误   java Android聊天在DataSnapshot上崩溃。用于时间戳的getValue()   获取java。文本ParseException:不可解析日期:“2020116135151”   使用模型属性应用角色的JavaSpring安全性