After updating grape to 1.2.5 target_class options seems not working
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ruby
- Lĩnh vực
- api, documentation
Hướng nghiên cứu
Reproduce the minimal Rails example and follow the stack trace into grape-swagger.rb, especially combine_routes around lines 27 and 41 and add_swagger_documentation around line 129. Check how target_class is passed after the grape 1.2.5 update; done means the example mounts without the nil.unshift error and the Swagger routes remain available.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello!
After we updated grape to 1.2.5 we can no longer mount grape (inside rails application),
here is minimal failing example:
# frozen_string_literal: true
module API
module V2
class Root < Grape::API
get :path do
end
end
class Documentation < Grape::API
add_swagger_documentation(
target_class: ::API::V2::Root,
)
end
end
end
and here is stack trace:
8: from /.../.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/api.rb:40:in `block (2 levels) in override_all_methods!'
7: from /.../.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/api.rb:144:in `add_setup'
6: from /.../.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/api.rb:144:in `each'
5: from /.../.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/api.rb:145:in `block in add_setup'
4: from /.../.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/api.rb:153:in `replay_step_on'
3: from /.../.rvm/gems/ruby-2.6.5/gems/grape-swagger-0.33.0/lib/grape-swagger.rb:129:in `add_swagger_documentation'
2: from /.../.rvm/gems/ruby-2.6.5/gems/grape-swagger-0.33.0/lib/grape-swagger.rb:27:in `combine_routes'
1: from /.../.rvm/gems/ruby-2.6.5/gems/grape-swagger-0.33.0/lib/grape-swagger.rb:27:in `each'
/.../.rvm/gems/ruby-2.6.5/gems/grape-swagger-0.33.0/lib/grape-swagger.rb:41:in `block in combine_routes': undefined method `unshift' for nil:NilClass (NoMethodError)
- Ngôn ngữ chính
- Ruby
- Star
- 1.1k
- Fork
- 477
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby-grape/grape-swagger
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ruby-grape/grape-swagger#1014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support default_response and default in 2.3; stop reading route.descCó thể đã có người làm @numbata đã nhận 62 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ruby-grape/grape-swagger#989 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
ruby-grape/grape-swagger#987 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug report: omitted array parameters with `array_use_braces: true`Có thể đã có người làm @olivier-thatch đã nhận 536 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
ruby-grape/grape-swagger#952 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Report: `default` for array params (`type: [String]`) is incorrectly placed inside `items`Có thể đã có người làm @numbata đã nhận 4 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
ruby-grape/grape-swagger#950 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ruby-grape/grape-swagger
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openhab/openhab-jruby#571 ·
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chatwoot/chatwoot#16591 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Tags Listing Shows Paging CountĐang mởgood first issue User Interface
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
rubyforgood/skillrx#740 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rubys/roundhouse#1917 ·
-
Store credit application selects a payment method from another storeCó thể đã có người làm @beobungbu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày