解析并捆绑openapi v3规范。
openapi-resolver的Python项目详细描述
openapi解析器
这个模块递归地解析openapi规范解析引用。
测试
测试通过本地运行
tox
circleci build
用法
该模块有一个嵌入式脚本,可以通过
$ python -m openapi_resolver --help
usage: __main__.py [-h] src_file [dst_file]
Recursively resolves and bundles OpenAPI v3 files.
positional arguments:
src_file An OpenAPI v3 yaml file.
dst_file Destination file, default is stdout.
optional arguments:
-h, --help show this help message and exit
要从spec文件创建openapi包,只需运行
$ python -m openapi_resolver sample.yaml
在扩散之前,您可以使用此模块规范化两个规格,例如:
$ python -m openapi_resolver one.yaml normal-one.yaml
$ python -m openapi_resolver two.yaml normal-two.yaml
$ diff normal-one.yaml normal-two.yaml