如何将多个 OpenAPI 3 规范文件组合在一起? [英] How do I combine multiple OpenAPI 3 specification files together?

查看:36
本文介绍了如何将多个 OpenAPI 3 规范文件组合在一起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想合并使用 OpenAPI 3 规范编写的 API 规范,该规范目前分为多个文件,这些文件使用 $ref 相互引用.我该怎么做?

I want to combine an API specification written using the OpenAPI 3 spec, that is currently divided into multiple files that reference each other using $ref. How can I do that?

推荐答案

一种方法是使用开源项目 speccy.

One way to do this is to use the open-source project speccy.

打开终端并通过运行安装speccy(需要Node.js):

Open the terminal and install speccy by running (requires Node.js):

npm install speccy -g

然后运行:

speccy resolve path/to/spec.yaml -o spec-output.yaml

这篇关于如何将多个 OpenAPI 3 规范文件组合在一起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆