【发布时间】:2018-12-14 18:59:10
【问题描述】:
我正在使用 SwaggerHub 和 OpenAPI 3.0.0。我在 SwaggerHub 中有两个 API。
第一个有以下访问链接:
https://app.swaggerhub.com/apis/myapipath/1.0.0 并包含一个名为 components/schemas/ApiOffer 的定义。
在第二个 API 中,我希望属性 offer 成为该定义的 $ref。我用:
components:
schemas:
Offerers:
type: object
required:
- offererId
- overview
properties:
offererId:
$ref: '#/components/schemas/OfferersId'
overview:
$ref: '#/components/schemas/OfferersOverview'
offer:
$ref: 'https://app.swaggerhub.com/apis/myapipath/1.0.0#/components/schemas/ApiOffer'
但得到以下错误:
“无法解析引用,因为:无法解析指针: /components/schemas/ApiOffer 在文档中不存在"
即使/components/schemas/ApiOffer 定义存在。
如何更正我的引用以使其指向其他 API?
【问题讨论】:
标签: swagger openapi swaggerhub