1.2. 导入 API 规格的不同源
作为 3scale 管理员可用于导入 API 规格,您可以获得不同的源。它们在下表中概述,它显示了从文件名路径、URL 和 stdin 中检测 OpenAPI 定义的使用情况选项。
描述 | 格式 | 命令行 |
---|---|---|
从文件名路径检测 OpenAPI 定义。格式会根据文件名扩展来决定。 | json 和 yaml |
$ 3scale import openapi -d <destination> /path/to/your/spec/file.[json|yaml|yml] |
从 URL 检测 OpenAPI 定义。格式会根据 URL 的路径扩展来决定。 | json 和 yaml |
$ 3scale import openapi -d <destination> http[s]://domain/resource/path.[json|yaml|yml] |
从 stdin 检测 OpenAPI 定义。OpenAPI 资源的命令行参数是 | json 和 yaml |
$ tool_to_read_openapi_from_source | 3scale import openapi -d <destination> - |