Custom mime types ignored in `produces`
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
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- openapi, ruby
- Lĩnh vực
- api, documentation
Hướng nghiên cứu
Start in grape-swagger/endpoint.rb at Grape::Endpoint#produces_object and follow the lookup into doc_methods/produces_consumes.rb. Compare that lookup with the custom :content_types settings described in the issue, then check the corresponding consumes path. Done means custom symbols produce their configured MIME values in the generated Swagger output for both produces and consumes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The default content types can be overridden using the DSL content_type, which adds to a :content_types Hash in the settings, which takes precedence over the default CONTENT_TYPES.
However, when generating documentation Grape::Endpoint#produces_object employs GrapeSwagger::DocMethods::ProducesConsumes to lookup mime types by symbol, and that goes directly to CONTENT_TYPES, bypassing any customisation.
class MyApi < Grape::API
content_type :jsonapi, 'application/vnd.api+json'
resource :foo do
desc '/fooey', { produces: [:jsonapi] }
get do
{
# My JSON API response...
}
end
end
end
The generated Swagger will say
...
"paths": {
"/fooey": {
"get": {
"produces": ["jsonapi"]
}
}
}
...
rather than the expected "produces": ["application/vnd.api+json"]. You have to explicitly specify the mime type rather than the symbol to workaround.
I assume that consumes is similarly affected.
... Or is this as intended?
- Ngôn ngữ chính
- Ruby
- Star
- 1.1k
- Fork
- 477
- Merge trung bình
- 5 giờ 25 phút
- Pull request đã merge (30 ngày)
- 3
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
-
Support default_response and default in 2.3; stop reading route.descCó thể đã có người làm @numbata đã nhận 53 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
-
Length limits (minLength/maxLength, minItems/maxItems) are dropped from body params moved into a definitionCó thể đã có người làm @numbata đã nhận 3 ngày trước. Đang mở
ruby-grape/grape-swagger#1010 · 1 bình luận · 1 reaction · 1 người được giao ·
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 527 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`Đ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ự
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
geeksforsocialchange/PlaceCal#3838 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
matteocrippa/awesome-swift#2028 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Release workflow: a build provenance attestation for the gem with `actions/attest-build-provenance`Đang mởarea: devops area: security lane: strong-agent roadmap size: S type: task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
arminazimi/slipway#712 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fractaledmind/litestream-ruby#89 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày