【发布时间】:2021-06-01 14:30:05
【问题描述】:
我在设计我的 swagger API 服务模型并强调文本时正在处理巨大的 yaml 架构我想将 model 部分保存在另一个文件中,以便具有更大的灵活性和易读性。
按照this 文档,我使用了这部分代码:
components:
schemas:
Request:
title: Request
type: object
properties:
technicalData:
$ref: '../../schemas/foo.yaml/components/schemas/TechnicalData'
在我的foo.yaml 文件中,我有这样的东西:
components:
schemas:
TechnicalData:
type: object
properties:
application:
type: string
applicationCode:
type: string
userId:
type: string
它在本地主机上工作,但我在企业部署服务器上运行我的文件时遇到以下问题:
错误 解析器错误 components.schemas.Request.properties.technicalData.$ref 不能 解决参考,因为:不可接受
我已成功通过本地浏览器浏览我的文件。
上网查了一下,我发现了一些与我的主题相关的问题,但不幸的是不是很有用: https://github.com/swagger-api/swagger-editor/issues/1561
https://github.com/RepreZen/KaiZen-OpenAPI-Editor/issues/438
【问题讨论】: