我无法在其他文件夹之外使用 $ref,它只能在同一文件夹内使用,我使用相对路径不起作用 我尝试了很多解决方案并搜索了很多帖子,但它们不起作用
-src
-common
-responses.yaml
-company
-base_compamy.yaml
-company_list.yaml
-response.yaml
-...
...
200:
401:
$ref: '../common/responses.yaml/#/status/401'
404:
$ref: 'responses.yaml/#/status/404'
405:
$ref: 'responses.yaml/#/status/405'
412:
$ref: 'responses.yaml/#/status/412'
500:
$ref: 'responses.yaml/#/status/500'
...
status:
401:
description: "Token is invalid or is expired. Please login again."
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 401
message:
type: string
example: "Token is invalid or is expired. Please login again."
404:
description: "Not Found"
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 404
message:
type: string
如何解决?感谢您的阅读gg!!!!!!!!!!!!!!!!!!!!!!!!
锚点
#
应位于文件类型之后,指示您正在引用的文件的根目录。
$ref: '../common/responses.yaml#/status/401'