我正在使用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?
发布于 2018-11-12 10:27:07
对SwaggerHub定义的引用必须使用主机名API.swaggerhub.com而不是APP.swaggerhub.com。
https://stackoverflow.com/questions/53260146
复制相似问题