问题
无法将 swagger 2.0 转换为受 Postman 导入功能影响的格式
Unable to convert swagger 2.0 into a format which is being affected by Postman import functionality
通过 /swagger.json|yaml
生成
使用 swagger 通过 dropwizard jetty 暴露的 Swagger 端点
Swagger endpoint exposed via dropwizard jetty using swagger
swagger-core:1.5.17swagger-jaxrs:1.5.17swagger-jersey2-jaxrs:1.5.17swagger 模型:1.5.17尝试
尝试通过导入屏幕手动导入 JSON 或 YAML 版本
Tried manually importing the JSON or YAML versions via the import screen
导入文件从链接导入粘贴原始文本尝试使用以下方法转换为不同的格式:api-spec-converter 和swagger2-postman-generator
Tried converting to different formats using: api-spec-converter and swagger2-postman-generator
结果
导入错误:必须包含信息对象
问题
有没有人设法解决这个问题,允许导入
Has anyone managed to get around this issue allowing the import
在 Swagger 2.0 中,info 字段是强制性的.只需将以下内容添加到您的 YAML 根目录:
In Swagger 2.0 the info field is mandatory. Just add the following to your YAML root:
info:
title: 'EmptyTitle'
description: 'EmptyDescription'
version: 0.1.0
或者如果你有 JSON 格式(在根目录中),也可以这样:
Or like this if you have it in JSON format (in the root too):
"info": {
"title": "EmptyTitle",
"description": "EmptyDescription",
"version": "0.1.0"
}
希望对您有所帮助!
上一篇:POSTMAN 正在返回值更改的日期字段字段、返回值、日期、POSTMAN
下一篇:如何为 Azure 表存储 REST 请求生成 SharedKeyLite何为、Azure、SharedKeyLite、REST