【问题标题】:Unable to generate documentation with grape-swagger无法使用葡萄招摇生成文档
【发布时间】:2022-09-30 12:56:20
【问题描述】:

我正在尝试用grape-swagger 生成文档。

在我的宝石文件上

gem \'grape-entity\'
gem \'grape-swagger\'
gem \'grape-swagger-entity\'
gem \'grape-swagger-rails\'

在我的端点上

require \'grape-swagger\'
module MyModule
  class Api < Grape::API
    content_type :json, \'application/json\'
    default_format :json
    format :json

    mount V1::Root
    add_swagger_documentation
  end
end

当我访问 http://localhost:3000/swagger_doc 时出现错误,

No route matches [GET] \"/swagger_doc\".

我也没有看到任何文档生成。

    标签: swagger ruby-grape


    【解决方案1】:

    如果您安装了根以外的位置,请添加前缀。

    例如 /api/swagger_doc

    【讨论】:

      猜你喜欢
      • 2016-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-19
      • 2023-03-11
      相关资源
      最近更新 更多