Grape-Swagger:路由参数问题

问题描述 投票:0回答:1

我正在使用葡萄招摇来显示我正在使用 Grape 构建的 Ruby API 的文档。

我正在为端点上的所有参数添加描述,但我似乎找不到有关如何向路由参数添加描述的任何信息。

我尝试过以下方法:

route_param :monitor_name, type: String, desc: 'The name of the monitor that is being retrieved.' do

route_param :monitor_name, type: String, description: 'The name of the monitor that is being retrieved.' do

但是这些都不会在 swagger UI 上显示实际描述。

有什么想法吗?

附注(我在grape文档中找到的唯一内容显示在附加图像中)

enter image description here

ruby swagger documentation ruby-grape
1个回答
0
投票

你可以使用

route_param :monitor_name, type: String, documentation: { desc:'The name of the monitor that is being retrieved.' }
© www.soinside.com 2019 - 2024. All rights reserved.