Reputation: 4222
I'm using Grape (on Rails 4), Swagger and Swagger-UI to document my Grape API. Now I wonder how to group routes like the Swagger example: http://petstore.swagger.wordnik.com/
Thats how my Swagger-UI currently looks:
Upvotes: 2
Views: 2371
Reputation: 548
If you define your endpoint within a resource
block, for example:
module MyApiModule
class MyApiClass < Grape::API
resource :foo do
get :time do
{epoch_time: Time.now.to_i.to_s}
end
end
resource :bar do
get :bar_time do
{epoch_bar_time: Time.now.to_i.to_s}
end
end
end
end
... you will see this nice separators:
Upvotes: 2