Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Documentation for ResourceSerializer with includes is incorrect

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

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
documentation

Hướng nghiên cứu

Bắt đầu với phần include trong hướng dẫn serializer v0.10 và so sánh ví dụ của phần này với test/unit/serializer/serializer_test.rb quanh các dòng 205-226. Tái hiện lời gọi ResourceSerializer được ghi trong tài liệu, sau đó xác định liệu tài liệu hay hành vi của serializer là không chính xác. Công việc được xem là hoàn tất khi workflow include được ghi trong tài liệu là chính xác và được bao phủ bởi một test tập trung.

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

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. NOTE - I tried to ask in Gitter but it sends me in an infinite redirect loop when I try to sign in.
  • 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. NOTE - I attempted to create a complete bug report, but I'm not sure how to use the template, and can't seem to find documentation about how it's supposed to be used and my best guess of running ruby rails_5_master.rb doesn't seem to work.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Choose one section below and delete the other:

Bug reports:

The documentation says that ResourceSerailizer should be able to include resources by doing something like this:

post = Post.find(1)

JSONAPI::ResourceSerializer.new(PostResource,
  include: ['comments'],
).serialize_to_hash(PostResource.new(post, nil))

But when I do this I don't get an included section in the serialized output.

Additionally I don't find any tests in the test suite that demonstrate the documented way of doing it, but I find several tests that seem to achieve includes via much more verbose and laborious methods.

Am I missing something?

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

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.

Issue khác của JSONAPI-Resources/jsonapi-resources

Tất cả issue của JSONAPI-Resources/jsonapi-resources

Issue tương tự

Thêm issue về Ruby

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.