[Java] Add deserialize overloads that take a TypeRef

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

Maintainer thường phản hồi trong vòng 1 ngày

@Swatantra-66 đang làm issue này rồi.

Từ ngày 10/10/2026.

  • #4163 của @Swatantra-66 — đang mở

Đá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
68/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với Fory.deserialize và so sánh các overload ForyJson.fromJson hiện có nhận TypeRef. Theo dõi cách TypeResolver và ReadContext được sử dụng, sau đó thêm các overload được yêu cầu và xác nhận rằng các kiểu gốc generic có thể được deserialize thông qua API cấp cao.

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

Mô tả

Feature Request

ForyJson has fromJson methods that accept a Class, but also has overloads that accept a TypeRef for cases when the root type is generic.

Fory does not have such overloads, so it is not possible to explicitly deserialize into generic root types.

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

It would be great if Fory.deserialize added such overloads

Describe alternatives you've considered

I tried TypeResolver.getSerializer, but couldn't figure out where to get the ReadContext for the resulting Serializer - it seemed like using too low-level tools for a high-level goal.

Additional context

No response

Ngôn ngữ chính
Java
Star
4.6k
Fork
470
Merge trung bình
9 giờ 28 phút
Pull request đã merge (30 ngày)
33

Chuẩn bị môi trường

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 apache/fory

Tất cả issue của apache/fory

Issue tương tự

Thêm issue về Java

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.