我正试着用葡萄自夸来生成文档。
我的创业板档案
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".
而且,我没有看到任何文档生成。
发布于 2022-09-30 04:56:20
如果您已挂载了根以外的位置,则添加前缀。
例如/api/swagger_doc
https://stackoverflow.com/questions/73306954
复制相似问题