ruby-grape / grape-swagger

Add OAPI/swagger v2.0 compliant documentation to your grape API
MIT License
1.09k stars 471 forks source link

namespace with desc not work #611

Open TangMonk opened 7 years ago

TangMonk commented 7 years ago

I am using rails 5.1.1 and ruby 2.4.1, grape and grape-swagger is the latest version

this following code did not generate swagger tag description,

resource :medicals, desc: "医生" do
  params do
    requires :phone
    requires :sms_code
    requires :password
  end
  post 'sign_up' do
    medical = Medical.new(phone: params[:phone], password: params[:password])

    if medical.save
      present_v medical, with: V1::Entities::Medical
    else
      resource_error!(medical)
    end
  end
end
TangMonk commented 7 years ago

Now I have to add tag description in documentation using this following way:

add_swagger_documentation(
      format: :json,
      tags: [
        { name: 'medicals', description: '医生操作' }
      ]
    )
LeFnord commented 7 years ago

Hi @TangMonk … is it still relevant? then please provide at first a spec, so we have a use case, thanks