swagger解析器提供有关swagger文件的有用信息

swagger-parser的Python项目详细描述


Travis statusJoin the chat at https://gitter.im/Trax-air/swagger-parserhttps://img.shields.io/pypi/v/swagger-parser.svg

摇摆分析器

swagger parser是一个python模块,允许您访问有关swagger文件的一些有趣的数据。就像从定义名称中获取字典示例一样,获取字典的定义等等。

示例用法

fromswagger_parserimportSwaggerParserparser=SwaggerParser(swagger_path='swagger_path')# Init with fileparser=SwaggerParser(swagger_dict={})# Init with dictionary# Get an example of dict for the definition Fooparser.definitions_example.get('Foo')# Get the definition of a dictionarytest={'foo':'bar'}parser.get_dict_definition(test)# Validate the definition of a dictparser.validate_definition('Foo',test)# Validate that the given data match a path specificationparser.validate_request('/foo','post',body=test,query={'foo':'bar'})# Get the possible return value of a path# It will return a dictionary with keys as status_code# and value as example of return value.parser.get_request_data('/foo','post',body=test)# Get an example of a correct body for a pathparser.get_send_request_correct_body('/foo','post')

文件

更多文档可在https://swagger-parser.readthedocs.org/en/latest/找到。

设置

进行安装pip install swagger parser

许可证

swagger解析器是在http://opensource.org/licenses/MIT下授权的。

历史记录

1.0.0(2017-6-11)

0.1.11(2016-9-25)

  • 支持其他属性。

0.1.10(2016-8-25)

  • 如果没有定义,不要窒息
  • 生成不带operationid的操作
  • 从属性生成示例

0.1.9(2016-7-28)

  • 支持数组定义。

0.1.8(2016-5-11)

  • 支持类型字段为数组。
  • 使用基本路径验证请求。

0.1.7(2016-4-1)

  • 在swagger.yaml中支持utf-8。

0.1.6(2016-3-16)

  • 添加对路径级别参数的支持。

0.1.5(2016-2-17)

  • 添加对路径等级库中参数引用的支持。

0.1.4(2016-2-10)

  • 将字符串作为状态代码处理。

0.1.3(2016-2-3)

  • 修复get_response_示例中仅包含类型字段的架构的错误。

0.1.2(2016-2-3)

  • 只支持类型字段的架构。

0.1.1(2016-1-31)

  • 把执照改成麻省理工学院。

0.1(2016-1-28)

  • pypi上的第一个版本。

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

推荐PyPI第三方库


热门话题
java在读取属性文件时获取空指针   java NoSuchMethodError:org。springframework。靴子网状物servlet。错误错误控制器。最新SpringCloudStarter NetflixZuul中的getErrorPath()   java Spring不使用相同的JDBC连接   sqlite DB中带方括号的java数据   如何编译基于Maven的Java项目以从命令行运行它   java如何限制cowndown计时器的操作(例如登录)   java如何使用spring和springboot应用程序配置数据库?我想知道如何回答这类问题?   java中的buildpath不支持java。图书馆路径   java如何使用条目集在树映射上迭代?   java如何将IndexOf与Scanner结合使用?   xml Java SAX解析器进程监视   java在多台远程机器上运行并行junit测试   当我尝试在ListView中动态添加项时,单击按钮时java崩溃