Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3172 Fix: 枚举类 ValueField 的类型为 Integer 时,无法反序列化 String 类型的值 #3173

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

cnscoo
Copy link
Contributor

@cnscoo cnscoo commented Nov 23, 2024

What this PR does / why we need it?

当枚举类 ValueField 的类型为非 String 类型时,无法通过 String 类型的值反序列化,在一些参数接收枚举类型时不方便

Summary of your change

当枚举类 ValueField 的类型为非 String 类型时,在 ObjectReaderImplEnum 类中也会缓存一份 String 化的值,在反序列化时,如果其他类型匹配失败,可以使用 String 类型的值进行匹配,从而获取正确的枚举元素。

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@wenshao wenshao merged commit e6ff30a into alibaba:main Nov 24, 2024
5 checks passed
@wenshao wenshao added this to the 2.0.54 milestone Nov 24, 2024
@cnscoo cnscoo deleted the issue_3172 branch November 24, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants