title: Swagger Docs UI - "Can't read from file /apidocs/api-docs.json"
body: <p>I'm trying to use swagger-ui with the swagger-docs gem. When visiting, the ui interface it fails with the error below.</p>
  
  <h3>error</h3>
  
  <pre><code>"Can't read from file /apidocs/api-docs.json"
  </code></pre>
  
  <h3>public/apidocs/api-docs.json (generated by gem)</h3>
  
  <pre><code>{
    "apiVersion": "1.0",
    "swaggerVersion": "1.2",
    "basePath": "http://localhost:3000",
    "apis": [
      {
        "path": "/apidocs/api/v1/users.{format}",
        "description": "Users"
      }
    ],
    "authorizations": null,
    "info": {
      "title": "HAPIE API Documention",
      "contact": "antarr.byrd@gmail.com",
      "license": "Apache 2.0",
      "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  }
  </code></pre>
  
  <h3>routes.rb</h3>
  
  <pre><code>  get '/docs' =&gt; redirect('/swagger/dist/index.html?url=/apidocs/api-docs.json')
  </code></pre>
  
  <h3>swagger-doc.rb</h3>
  
  <pre><code># config/initializers/swagger-docs.rb
  class Swagger::Docs::Config
    def self.transform_path(path, api_version)
      # Make a distinction between the APIs and API documentation paths.
      "apidocs/#{path}"
    end
  end
  
  Swagger::Docs::Config.base_api_controller = Api::V1::ApiController
  
  Swagger::Docs::Config.register_apis({
    "1.0" =&gt; {
      :api_extension_type =&gt; :json,
      # location where our api doc files will be generated, as of now we will store files under public directory
      :api_file_path =&gt; "public/apidocs",
      # base path url of our application
      # while using production mode, point it to production url
      :base_path =&gt; "http://localhost:3000",
      # setting this option true tells swagger to clean all files generated in api_file_path directory before any files are generated
      :clean_directory =&gt; true,
      # As we are using Rails-API, our ApplicationController inherits ActionController::API instead of ActionController::Base
      # Hence, we need to add ActionController::API instead of default ActionController::Base
      :base_api_controller =&gt; Api::V1::ApiController,
      # parent_controller needs to be specified if API controllers are inheriting some other controller than ApplicationController
      :parent_controller =&gt; Api::V1::ApiController,
      :attributes =&gt; {
        :info =&gt; {
          "title" =&gt; "HAPIE API Documention",
          # "description" =&gt; "How Swagger works",
          "contact" =&gt; "antarr.byrd@gmail.com",
          "license" =&gt; "Apache 2.0",
          "licenseUrl" =&gt; "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
      }
    }
  })
  </code></pre>