We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
枚举类型自定义反序列化,调用readObejct时传入targetClass,用于反序列化具体的枚举
com.alibaba.fastjson2.util.TypeUtils.cast方法(第1501行) 原代码: return (T) objectReader.readObject(jsonReader, null, null, 0); 建议改为: return (T) objectReader.readObject(jsonReader, targetClass, null, 0); 这样就可以具体的枚举
对您考虑过的任何替代解决方案或功能的描述。
版本: V2.0.46 反序列化是采用JSONType注解到枚举类 @jsontype(serializer = DictSerializer.class, deserializer = DictDeserializer.class, writeEnumAsJavaBean = true) public enum AuthStrengthType implements IDict
The text was updated successfully, but these errors were encountered:
fix The Type#cast method calls readObject without passing in the para…
8b03d70
…meter type, #2329
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.48-SNAPSHOT/ 问题已修复,请帮忙用2.0.48-SNAPSHOT版本帮忙验证,2.0.48版本预计在3月底前发布。
Sorry, something went wrong.
https://github.com/alibaba/fastjson2/releases/tag/2.0.48 请用新版本
已测试,功能已实现
No branches or pull requests
请描述您的需求或者改进建议
枚举类型自定义反序列化,调用readObejct时传入targetClass,用于反序列化具体的枚举
请描述你建议的实现方案
com.alibaba.fastjson2.util.TypeUtils.cast方法(第1501行)
原代码:
return (T) objectReader.readObject(jsonReader, null, null, 0);
建议改为:
return (T) objectReader.readObject(jsonReader, targetClass, null, 0);
这样就可以具体的枚举
描述您考虑过的替代方案
对您考虑过的任何替代解决方案或功能的描述。
附加信息
版本: V2.0.46
反序列化是采用JSONType注解到枚举类
@jsontype(serializer = DictSerializer.class, deserializer = DictDeserializer.class, writeEnumAsJavaBean = true)
public enum AuthStrengthType implements IDict
The text was updated successfully, but these errors were encountered: