HMCL-dev / HMCL-dev/HMCL

[Feature] 使用注解标识需要通过 Gson 序列化/反序列化的类

Open
#4,461 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

概述 | Summary

使用注解标识需要通过 Gson 序列化/反序列化的类。

原因 | Reason

需要通过 Gson 序列化/反序列化的类不能随意的修改字段名称,但 IDE 又无法简单地追踪到这些用法,所以有时候可能会意外的破坏掉其他功能。
为了方便开发者追踪它们,我希望在代码中标记这些类。

详情 | Description

我目前想到两种选择:

  1. 创建一个新的注解,用它注解所有需要被反序列化的类;
  2. 要求未来所有要被序列化的字段都使用 SerializedName 注解。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the existing Gson serialization and deserialization usage, then compare the two approaches described in the issue: a class-level annotation or requiring SerializedName on serialized fields. Done should include a decided approach and an agreed implementation scope, but the issue does not name files or tests to start from.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.