我正在使用葡萄招摇来显示我正在使用 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文档中找到的唯一内容显示在附加图像中)
你可以使用
route_param :monitor_name, type: String, documentation: { desc:'The name of the monitor that is being retrieved.' }