JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Nested included resources filters

Đang mở
#1,255 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Ruby
Star
2.3k
Fork
546
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Hi guys, I'm sorry about how this issue is looking, don't have time to make it better.
Currently, (checked on 0.9.5, and it's probably the same on 0.9.7) filtering on nested resources works only for 1 level deep inclusion, i.e. included_resource.filter_key. I made some monkey-patches in my app, to make it work with nested resources inclusion, i.e. included_resource.another_included_resource.filter_key.
Also, I did some changes to make filters work with has_one relationships.

The code can be a little bit messy, but it's working, at least for my project. No blame, please :)

The code is here: https://gist.github.com/RoM4iK/1ce4eab45ed0ceafa8728ed487ccddbb

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách xem xét Gist được liên kết và xác định điểm vào hiện có để lọc tài nguyên trong repository. So sánh hành vi hiện tại của tài nguyên lồng nhau ở một cấp với việc lồng nhau sâu hơn được yêu cầu và các quan hệ has_one. Được xem là hoàn thành khi các bộ lọc lồng nhau hoạt động ở nhiều cấp độ bao gồm, bao gồm cả các tài nguyên has_one, và các bài kiểm thử của project bao quát hành vi này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rails, ruby
Lĩnh vực
backend-api-design
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.