Node.js 引用其他文件NodeJS时发生OpenApi错误

Node.js 引用其他文件NodeJS时发生OpenApi错误,node.js,typescript,swagger,swagger-ui,openapi,Node.js,Typescript,Swagger,Swagger Ui,Openapi,我想在我的NodeJS项目中引用其他yaml文件 我的主yaml文件如下所示 openapi: 3.0.3 info: title: test description: Description version: 0.0.1 servers: - url: http://localhost:3000 variables: basePath: default: / description: Local server with default

我想在我的NodeJS项目中引用其他yaml文件

我的主yaml文件如下所示

openapi: 3.0.3
info:
  title: test
  description: Description
  version: 0.0.1
servers:
  - url: http://localhost:3000
    variables:
      basePath:
        default: /
    description: Local server with default port
paths:
  /sign-in:
    post:
      summary: Test.
      description: Test.
      requestBody:
        $ref: "test.yaml"
      responses:
        '200':
          $ref: "test.yaml"
test.yaml文件如下所示:

description: Optional description in
required: true
content:
  application/json:
    schema:
      type: object
      required:
         - id
      properties:
        id:
          type: string
我生成的招摇过市文档出错了

我用它来制造虚张声势

我的招摇过市用户界面配置:

app.use(OpenApiValidator.middleware({
    apiSpec: 'schemas/openapi.yaml',
    validateRequests: true,
    validateResponses: true
}));
使用./test.yaml代替test.yaml无效