I am trying to use grape-swagger gem for creating the auto-generated documentation for my Grape API.
Using 'grape'
gem I have created few APIs.
Example:
http://localhost:9292/api/v1/charges
This API is working fine.
Following documentation of 'grape-sagger', I am not able to generate the API documentation properly.
My steps:
1) I added below in the gemfile
gem 'grape-swagger'
2) I also used rack-cors to enable CORS by adding below in config.ru
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [ :get, :post, :put, :delete, :options ]
end
end
Also added below in gemfile.
gem 'rack-cors', :require => 'rack/cors'
3) Also I added below at the end in my API class
add_swagger_documentation
But when I run http://localhost:9292/api/v1/swagger_doc, I am not getting the proper paths. I need the API path like http://localhost:9292/api/v1/charges, but it is returning as http://localhost:9292/api/v1/swagger_doc/charges
Do I need to set any other configuration?