grape-swagger icon indicating copy to clipboard operation
grape-swagger copied to clipboard

Detail mixes into adjacent route definition

Open run27017 opened this issue 5 years ago • 0 comments

In desc method, I found the detail definition will be integrated into response entity description. And what's worse, it will contaminate following route definition, which leads to using above detail content. The following code can show it:

    resources :students do
      desc 'Create a student',
        summary: 'Create a student',
        detail: 'This is detail for post api.',
        entity: Entities::Student
      post '' do
      end

      desc 'List users',
        summary: 'List users',
        detail: 'This is detail for get api.',
        entity: Entities::Student
      get '' do
      end
    end

And the get api render the doc is below, noticing the entity description:

image

run27017 avatar Apr 26 '20 08:04 run27017