Grape (Rails 4)、Swagger、および Swagger-UI を使用して、Grape API を文書化しています。ここで、Swagger の例のようにルートをグループ化する方法を知りたい: http://petstore.swagger.wordnik.com/
それが私の Swagger-UI の現在の外観です。
Grape (Rails 4)、Swagger、および Swagger-UI を使用して、Grape API を文書化しています。ここで、Swagger の例のようにルートをグループ化する方法を知りたい: http://petstore.swagger.wordnik.com/
それが私の Swagger-UI の現在の外観です。
resource
たとえば、ブロック内でエンドポイントを定義する場合:
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
...この素敵なセパレーターが表示されます: