测试您的swagger规范
项目描述
Swaggertest
这是一个非常简单的工具,用于测试swagger(OpenAPI)规范。特别是,它将文档中'components/schemas'部分提供的模式与随模式一起提供的任何示例进行比较。
安装
$ pip install swaggertest
用法
$ swaggertest --help
usage: swaggertest [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
[--pdb]
Swagger testing tool
optional arguments:
--version show program's version number and exit
-v, --verbose Increase verbosity of output. Can be repeated.
-q, --quiet Suppress output except warnings and errors.
--log-file LOG_FILE Specify a file to log output. Disabled by default.
-h, --help Show help message and exit.
--debug Show tracebacks on errors.
--pdb
Commands:
complete print bash completion command (cliff)
help print detailed help for another command (cliff)
test-schemas Validate examples against schemas
主要的子命令是 test-schemas
$ swaggertest help test-schemas
usage: swaggertest test-schemas [-h] [-d] [-p PATH] [-s] filename
Validate examples against schemas
positional arguments:
filename
optional arguments:
-h, --help show this help message and exit
-d, --detail
-p PATH, --path PATH Path to where the schemas are located
-s, --strict Default to 'allowExtraProperties: false'
要测试规范,只需将其作为 filename
参数提供。您还可以提供路径参数来指定模式所在的路径
$ swaggertest test petstore.json --path '/definitions' --detail --strict
Validated 6 schemas:
- 0 had errors
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。
源代码分布
swaggertest-0.1.1.tar.gz (4.5 kB 查看哈希值)
构建分布
swaggertest-0.1.1-py3-none-any.whl (9.3 kB 查看哈希值)
关闭
swaggertest-0.1.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 387c251e323e19daf80d3e0599f8d43c1e6032c1be96d9edc41e6bc8eb8359b0 |
|
MD5 | 189ca17932a2ba356592e1bc2fb83f49 |
|
BLAKE2b-256 | e1159c842bf962fac38bef86f0d992ea193b45c21b33ea3d2eddac3627593857 |