0

After following the getting started steps of Apipie:

  1. echo "gem 'apipie-rails'" >> Gemfile
  2. bundle install
  3. rails g apipie:install

And documenting a controller like this:

api :GET, '/users/:id'
param :id, :number, desc: 'id of the requested user'
def show
  # ...
end

I got the following routing error when accessing the route /apipie:

Routing Error No route matches [GET] "/apipie"

1 Answers1

0

Apipie requires having an API route called apipie in the routes.rb ruby on rails file. The solution that worked for me is to manually add this line to routes.rb along side any other routes in the project:

#config/routes.rb
...
apipie #required gem route
get 'profile', to: 'users#show' #example route
...
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Lomefin Oct 13 '21 at 00:25