Rails Swagger-UI无法读取昂首阔步的JSON

时间:2016-08-05 18:18:54

标签: ruby-on-rails json swagger-ui grape-api

我已经尝试了很多方法,但我只是坚持到这里。

Grape API完全可以postget,但是swagger-ui遇到了一些问题。

当我打开它时,我将swagger-ui放在公共文件夹中。它扔了

Can't read swagger JSON from http://localhost:3000/v1/doc

这是 api.rb

module FruitAPI
  class API < Grape::API 
    version 'v1', using: :header, vendor: 'fruit_api'
    format :json
    prefix :api
    ...
    add_swagger_documentation(
      basd_path: "/v1",  #Swagger的base url
      mount_path: 'doc', 
      info: {
        title: 'Fruit API', 
        description: "A description of the API."
        },
        hide_documentation_path: true,
        hide_format: true,
        include_base_url: true
        )
  end
end

0 个答案:

没有答案