如何从另一个 OpenAPI 文件导入组件?
How to import a component from another OpenAPI file?
能否导入在其他 OpenAPI 文件中定义的组件?
假设我有两个 openAPI 文件:
openAPI.yaml
和 otherOpenAPI.yaml
。
在 openAPI.yml
中,我想使用在 otherOpenAPI.yaml
中定义的 myItem
组件
我可以做一些类似的事情吗:
$ref: './otherOpenAPI.yaml/components/myItem
?
您可以使用:
$ref: './otherOpenApi.yaml#/components/MyItem'
能否导入在其他 OpenAPI 文件中定义的组件?
假设我有两个 openAPI 文件:
openAPI.yaml
和 otherOpenAPI.yaml
。
在 openAPI.yml
中,我想使用在 otherOpenAPI.yaml
myItem
组件
我可以做一些类似的事情吗:
$ref: './otherOpenAPI.yaml/components/myItem
?
您可以使用:
$ref: './otherOpenApi.yaml#/components/MyItem'