【发布时间】:2020-03-04 16:23:25
【问题描述】:
我尝试遵循本指南:https://blog.cloudboost.io/adding-swagger-to-existing-node-js-project-92a6624b855b。我将此行更改为使用 YAML:
swaggerDocument = require('./swagger.yml');
Swagger 编辑器中的示例不起作用。 http://editor.swagger.io/
tags:
- name: "pet"
description: "Everything about your Pets"
出现此错误:
- name: "pet"
^
SyntaxError: Unexpected token :
我尝试更改缩进,但没有帮助。我查看了规范,但它说没关系:https://yaml.org/spec/1.2/spec.html#id2761803
【问题讨论】: