【发布时间】:2020-02-17 22:38:58
【问题描述】:
在我的 node.js 应用程序中设置 swagger 时遇到问题。我使用swagger-jsdoc 和swagger-ui-express 来创建文档。这是版本
“swagger-jsdoc”:“3.5.0”,“swagger-ui-express”:“4.1.3”
下面是我传递给 swagger-jsdoc 的配置。
openapi: 3.0.0
info:
description: test
version: 3.0.0
title: U-CRM api documentation
termsOfService: http://swagger.io/terms/
servers:
- url: 'https://localhost:5000'
description: Local server
tags:
- name: U-CRM
description: CRM for university
components:
parameters:
$ref: 'components/parameters/index.yml'
schemas:
$ref: 'components/schemas/index.yml'
paths:
$ref: '#/paths/index.yml'
毕竟,我得到一个错误
无法读取未定义的属性“参数”
实际上,当我仔细阅读 swagger 文档时,这让我感到惊讶。 可能是什么问题?
【问题讨论】:
-
editor.swagger.io/… 把你的配置贴在那里
-
谢谢你,但我的问题与此无关。我知道我可以在那里测试,但问题是我将我的文档分成不同的文件。
标签: javascript node.js express swagger openapi