Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.46k stars 457 forks source link

uninitialized constant MyEngine::Apipie #516

Open seanhandley opened 7 years ago

seanhandley commented 7 years ago

I've got Apipie set up inside a Rails engine which I'm then including into a Rails 5 app and mounting in the routes.

The controllers in my engine are working correctly because I'm getting results from them when I make requests. I can even define render text: Apipie.configuration.inspect and get a plaintext representation of my Apipie config.

#, @app_name="DataCentred RESTful API", @app_info={"v1"=>" # Authentication\n\n Use the `Authorization` header to supply your access key and secret key:\n\n
\n  curl 'https://calm-cove-59936.herokuapp.com/status' \\\n  -H 'Authorization: Token ACCESS_KEY:SECRET_KEY'
\n\n # Versions & Formats\n\n Target specific versions and formats by using the `Accept` header:\n\n
\n  curl 'https://calm-cove-59936.herokuapp.com/status' \\\n  -H 'Accept: application/vnd.datacentred.api+json; version=1'
\n\n Supported formats: json, xml, csv\n"}, @copyright="DataCentred Ltd 2017", @validate=false, @validate_value=true, @validate_presence=true, @validate_key=false, @required_by_default=false, @api_base_url={"1.0"=>""}, @doc_base_url="/docs", @layout="apipie/apipie", @disqus_shortname=nil, @default_version="v1", @debug=false, @version_in_url=true, @namespaced_resources=false, @doc_path="doc", @process_params=false, @checksum_path=["/apipie", "/api/"], @update_checksum=false, @link_extension=".html", @record=false, @languages=[], @default_locale="en", @locale=#, @translate=#, @persist_show_in_doc=false, @routes_formatter=#, @api_controllers_matcher="/Users/sean/src/datacentred/harbour/app/controllers/harbour/**/*.rb", @ignored=[]>

The error is being raised from static_dispatcher.rb line 65 (version 0.3.7): uninitialized constant Harbour::Apipie when I try to load /api/docs.

Any ideas?

seanhandley commented 7 years ago
rake routes

Routes for Harbour::Engine:
apipie_apipie_checksum GET    /docs/apipie_checksum(.:format)                  harbour/apipie/apipies#apipie_checksum {:format=>/json/}
         apipie_apipie GET    /docs(/:version)(/:resource)(/:method)(.:format) harbour/apipie/apipies#index {:version=>/[^\/]+/, :resource=>/[^\/]+/, :method=>/[^\/]+/}
                  root GET    /                                                redirect(301, /api/docs)
                 users GET    /users(.:format)                                 harbour/v1/users#index
                       POST   /users(.:format)                                 harbour/v1/users#create
              new_user GET    /users/new(.:format)                             harbour/v1/users#new
             edit_user GET    /users/:id/edit(.:format)                        harbour/v1/users#edit
                  user GET    /users/:id(.:format)                             harbour/v1/users#show
                       PATCH  /users/:id(.:format)                             harbour/v1/users#update
                       PUT    /users/:id(.:format)                             harbour/v1/users#update
                       DELETE /users/:id(.:format)                             harbour/v1/users#destroy