我最近开始学习Swagger for APi文档。然而,当我转到localhost:5000/apidocs时,我看到了我添加的API,但是所有的API都没有参数,即使我已经在yml文件中描述了参数。我在网上找不到任何相关的东西。
下面是我的YML代码:
paths:
/api/ppp:
get:
tags:
- "user"
summary: "Find User by uID"
description: "Returns a single user info"
operationId: "getuserById"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "userId"
in: "path"
description: "ID of user to return"
required: true
type: "uuid"下面是我如何将swagger添加到api @swag_from('pathto/swagger.yml')
同样,我还有另一个疑问。我们在yml规范文件中定义模式。我想知道这些模式到底代表了什么,有必要使用它们吗?
附件是APIdocs页面的屏幕截图

发布于 2021-04-30 00:48:42
试试这个:
tags:
- user
summary: "Find User by uID"
description: "Returns a single user info"
operationId: "getuserById"
produces:
- "application/xml"
- "application/json"
parameters:
- name: "userId"
in: "path"
description: "ID of user to return"
required: true
type: "uuid"https://stackoverflow.com/questions/66526695
复制相似问题